ix.util
Class FanComposer
java.lang.Object
ix.util.FanComposer
public class FanComposer
- extends java.lang.Object
Composes Object-to-Collection mappings ("fans"). A "fan" is
just a convenient term for a one-to-many mapping: think of
each one-to-many as having a fan-like shape.
The result is not constructed until requested by a call
to the getResultMap()
method. The "apply" methods
just remember the map or graph and invalidate any existing
result.
The result is a map made by a call to makeResultMap()
,
and the values in that map are collections each made by the
makeValueCollection()
method. In this class, they
construct a StableHashMap
and a HashSet respectively.
Subclasses should override those methods if different classes
are desired.
Constructor Summary |
FanComposer(java.util.Collection keys)
Construct a FanComposer that will build a map that has
the specified keys. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
keys
protected java.util.Collection keys
allFans
protected LListCollector allFans
result
protected java.util.Map result
FanComposer
public FanComposer(java.util.Collection keys)
- Construct a FanComposer that will build a map that has
the specified keys.
apply
public void apply(java.util.Map m)
apply
public void apply(DirectedGraph g)
apply
public void apply(Function1 f)
getResultMap
public java.util.Map getResultMap()
- Return the result as a Map.
makeResultMap
protected java.util.Map makeResultMap()
makeValueCollection
protected java.util.Collection makeValueCollection()