<s> package org . eclipse . jdt . internal . compiler . util ; public final class HashtableOfInt { public int [ ] keyTable ; public Object [ ] valueTable ; public int elementSize ; int threshold ; public HashtableOfInt ( ) { this ( 13 ) ; } public HashtableOfInt ( int size ) { this . elementSize = 0 ; this . threshold = size ; int extraRoom = ( int ) ( size * 1.75f ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new int [ extraRoom ] ; this . valueTable = new Object [ extraRoom ] ; } public boolean containsKey ( int key ) { int length = this . keyTable . length , index = key % length ; int currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != 0 ) { if ( currentKey == key ) return true ; if ( ++ index == length ) { index = 0 ; } } return false ; } public Object get ( int key ) { int length = this . keyTable . length , index = key % length ; int currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != 0 ) { if ( currentKey == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = 0 ; } } return null ; } public Object put ( int key , Object value ) { int length = this . keyTable . length , index = key % length ; int currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != 0 ) { if ( currentKey == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = 0 ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { HashtableOfInt newHashtable = new HashtableOfInt ( this . elementSize * 2 ) ; int currentKey ; for ( int i = this . keyTable . length ; -- i >= 0 ; ) if ( ( currentKey = this . keyTable [ i ] ) != 0 ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "" ; Object object ; for ( int i = 0 , length = this . valueTable . length ; i < length ; i ++ ) if ( ( object = this . valueTable [ i ] ) != null ) s += this . keyTable [ i ] + " -> " + object . toString ( ) + "n" ; return s ; } } </s>