|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.anarres.jperf.PerfectMapGenerator<K,V>
org.anarres.jperf.PerfectObjectMapGenerator<K,V>
public class PerfectObjectMapGenerator<K,V>
| Constructor Summary | |
|---|---|
PerfectObjectMapGenerator()
|
|
| Method Summary | |
|---|---|
void |
add(K k,
V v)
Adds a key-value pair to the perfect map. |
int |
toHashCode(K key,
int rem)
Evaluates the hash function. |
Map<K,V> |
toMap()
Returns an optimal map based on the given key-value pairs. |
int |
toRemainder()
Generates the remainder for the perfect hash function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PerfectObjectMapGenerator()
| Method Detail |
|---|
public void add(K k,
V v)
PerfectMapGenerator
add in class PerfectMapGenerator<K,V>
public int toHashCode(K key,
int rem)
key.hashCode() & 0x7FFFFFFF) % rem
public int toRemainder()
public Map<K,V> toMap()
PerfectMapGeneratorPerfectMap - it might, for
example, be returned from
Collections.emptyMap().
toMap in class PerfectMapGenerator<K,V>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||