org.jjoost.collections
Class MultiSetNesting<V>

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

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

This class encapsulates the concept of nesting for objects that implement MultiSet. Three kinds of nesting are supported: INLINE, COUNTING 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 MultiSet that contains no duplicate keys should look structurally identical to a regular Set. A COUNTING MutliSet, however, should store an integer against each unique key, storing each key just once. A NESTED set should store each key just once, and store a list of each duplicate against that key.


Nested Class Summary
static class MultiSetNesting.Type
          An enumeration of the nesting types for MultiSet
 
Method Summary
static
<V> MultiSetNesting<V>
counting()
          Return a MultiSetNesting whose type is COUNTING
static
<V> MultiSetNesting<V>
inline()
          Return a MultiSetNesting whose type is INLINE
static
<V> MultiSetNesting<V>
nested()
          Return a MultiSetNesting whose type is NESTED
 MultiSetNesting.Type type()
          Return the MultiSetNesting.Type type of this MultiSetNesting
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

type

public MultiSetNesting.Type type()
Return the MultiSetNesting.Type type of this MultiSetNesting

Returns:
the MultiSetNesting.Type type of this MultiSetNesting

inline

public static <V> MultiSetNesting<V> inline()
Return a MultiSetNesting whose type is INLINE

Returns:
a MultiSetNesting whose type is INLINE

counting

public static <V> MultiSetNesting<V> counting()
Return a MultiSetNesting whose type is COUNTING

Returns:
a MultiSetNesting whose type is COUNTING

nested

public static <V> MultiSetNesting<V> nested()
Return a MultiSetNesting whose type is NESTED

Returns:
a MultiSetNesting whose type is NESTED