org.anarres.jperf
Class PerfectMapGenerator<K,V>
java.lang.Object
org.anarres.jperf.PerfectMapGenerator<K,V>
- Direct Known Subclasses:
- PerfectObjectMapGenerator, PerfectStringMapGenerator
public abstract class PerfectMapGenerator<K,V>
- extends Object
A perfect map generator.
Subclasses of this class may specify particular contracts for
the type of key processed.
|
Method Summary |
abstract void |
add(K k,
V v)
Adds a key-value pair to the perfect map. |
abstract Map<K,V> |
toMap()
Returns an optimal map based on the given key-value pairs. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PerfectMapGenerator
public PerfectMapGenerator()
add
public abstract void add(K k,
V v)
- Adds a key-value pair to the perfect map.
toMap
public abstract Map<K,V> toMap()
- Returns an optimal map based on the given key-value pairs.
This method may take some time to execute. The time tradeoff
happens here: to get faster runtime speed, time is sacrified
here.
The object returned from this method is not necessarily an
instance or subclass of
PerfectMap - it might, for
example, be returned from
Collections.emptyMap().
Copyright © 2002-2008 Shevek, Anarres. All Rights Reserved.