org.jjoost.collections
Class ListMapNesting<V>

java.lang.Object
  extended by org.jjoost.collections.ListMapNesting<V>

public class ListMapNesting<V>
extends java.lang.Object

This class encapsulates the concept of nesting for objects that implement ListMap. Two kinds of nesting are supported: INLINE and NESTED. INLINE indicates that the map should be structurally the same as if it did not support duplicates, only that duplicate records are handled correctly. i.e. an INLINE ListMap that contains no duplicate keys should look structurally identical to a regular Map. A NESTED ListMap, however, should store a MultiSet against every single key. If NESTED, a ListMapNesting requires a Factory> in order to produce each MultiSet we store against each key.


Nested Class Summary
static class ListMapNesting.Type
          An enumeration of the nesting types for ListMap
 
Method Summary
 Factory<MultiSet<V>> factory()
          Factory; ignored if type() == INLINE
static
<V> ListMapNesting<V>
inline()
          Public method for retrieving the ListMapNesting that represents INLINE nesting
static
<V> ListMapNesting<V>
nested(Factory<MultiSet<V>> factory)
          Public method for retrieving a ListMapNesting to represent the required NESTED nesting
 ListMapNesting.Type type()
          INLINE or NESTED *
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

type

public ListMapNesting.Type type()
INLINE or NESTED *

Returns:
the type

factory

public Factory<MultiSet<V>> factory()
Factory; ignored if type() == INLINE

Returns:
null if type() == INLINE, otherwise a factory

inline

public static <V> ListMapNesting<V> inline()
Public method for retrieving the ListMapNesting that represents INLINE nesting

Returns:
the list map nesting

nested

public static <V> ListMapNesting<V> nested(Factory<MultiSet<V>> factory)
Public method for retrieving a ListMapNesting to represent the required NESTED nesting

Parameters:
factory - the factory *
Returns:
the list map nesting