# Klassenmethoden
ClassDictionary.new_for(a_size)
	^self.new().init_for(a_size)
!
# Instanzmethoden
Dictionary.init_for(new_size)
	keys   = FixedVector.new(new_size);
	values = FixedVector.new(new_size);
	size   = 0;
	^self
!
Dictionary.indexFor(key)
    |i|
    i=0;
    while (i<size)
        if keys.at(i).eq(key) 
    	then
	    ^i
    	endif;
    	i = i + 1
    end;
    ^nil
!
Dictionary.at(key)
    |i|
    i = self.indexFor(key);
    if i.eq(nil) then
        ^nil
    else
	^values.at(i)
    endif
!
Dictionary.set(key,value)
	|i|
    i = self.indexFor(key);
	if i.eq(nil) then
        if size >= values.size then
	        self.extend(10)
        endif;
	    keys.set_nth(size,key);
	    values.set_nth(size,value);
	    size = size + 1
    else
		values.set_nth(i,value)
	endif
!
Dictionary.lprint()
	|i max|
    "<".simple_print();
	self.class_name.simple_print();
    " ".simple_print();
    i = 0;
	while (i<size)
		"(".simple_print();
		keys.at(i).print();
		",".simple_print();
		values.at(i).print();
		"),".simple_print();
	    i = i + 1
    end;
    ">".simple_print()
!
Dictionary.print()
	|i max|
    "<".simple_print();
	self.class_name.simple_print();
    " Size: ".simple_print();
    size.print();
    ">".simple_print()
!
Dictionary.extend(n)
    |old_v old_k|
    old_v = values;
    old_k = keys;
    values = FixedVector.new(size+n);
    keys   = FixedVector.new(size+n);
    values.copy_entries_from(old_v);
    keys.copy_entries_from(old_k);
    ^self
    errorhandler: hallo()
    
!
HashedDictionary.init_for(s)
	hash_keys   = FixedVector.new(1024);
	hash_values = FixedVector.new(1024);
	^super.init_for(s)
!
HashedDictionary.indexFor(key)
    |id v res|
    if nil.eq(key) then
        ^super.indexFor(key)
    endif;
    id = key.sys_hash_id();
    if (v = hash_keys.at(id)).eq(key).and((res=hash_values.at(id)).eq(nil).not ) then
        ^res
    endif;
    v = super.indexFor(key);
    hash_keys.set_nth(id,key);
	hash_values.set_nth(id,v);
	^v
!
HashedDictionary.lprint()
    super.print();
    hash_keys.print();
    hash_values.print()
