protected void setUp ( int initialCapacity , double minLoadFactor , double maxLoadFactor ) { int capacity = initialCapacity ; super . setUp ( capacity , minLoadFactor , maxLoadFactor ) ; capacity = nextPrime ( capacity ) ; if ( capacity == 0 ) capacity = 1 ; // open addressing needs at least one FREE slot at any time. this . table = new int [ capacity ] ; this . values = new Object [ capacity ] ; this . state = new byte [ capacity ] ; // memory will be exhausted long before this pathological case happens, anyway. this . minLoadFactor = minLoadFactor ; if ( capacity == PrimeFinder . largestPrime ) this . maxLoadFactor = 1.0 ; else this . maxLoadFactor = maxLoadFactor ; this . distinct = 0 ; this . freeEntries = capacity ; // delta // lowWaterMark will be established upon first expansion. // establishing it now (upon instance construction) would immediately make the table shrink upon first put(...). // After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young. // See ensureCapacity(...) this . lowWaterMark = 0 ; this . highWaterMark = chooseHighWaterMark ( capacity , this . maxLoadFactor ) ; }
Initializes the receiver .