K1
- The type of the primary keys in this DoubleKeyMapToListK2
- The type of the secondary keys in this DoubleKeyMapToListV
- The type of the values in this DoubleKeyMapToListpublic class DoubleKeyMapToList<K1,K2,V>
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
DoubleKeyMapToList()
Constructs a new DoubleKeyMapToList.
|
DoubleKeyMapToList(java.lang.Class<? extends java.util.Map> cl1,
java.lang.Class<? extends java.util.Map> cl2)
Creates a new, empty DoubleKeyMapToList using the given classes as the
underlying Map classes for the primary and secondary underlying Maps.
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(DoubleKeyMapToList<K1,K2,V> dkmtl)
Adds all of the contents of the given DoubleKeyMapToList to this
DoubleKeyMapToList.
|
void |
addAllToListFor(K1 key1,
K2 key2,
java.util.Collection<V> values)
Adds all of the Objects in the given list to the (internal) List for the
given keys.
|
void |
addToListFor(K1 key1,
K2 key2,
V valueElement)
Adds the given value to the List for the given keys.
|
void |
clear()
Clears this DoubleKeyMapToList.
|
DoubleKeyMapToList<K1,K2,V> |
clone()
Produces a clone of the DoubleKeyMapToList.
|
boolean |
containsInList(K1 key1,
K2 key2,
V valueElement)
Returns true if this DoubleKeyMapToList contains a List for the given
keys and that list contains the given value.
|
boolean |
containsListFor(K1 key1)
Returns true if this DoubleKeyMapToList contains a List for the given
primary key (and any secondary key).
|
boolean |
containsListFor(K1 key1,
K2 key2)
Returns true if this DoubleKeyMapToList contains a List for the given
keys.
|
boolean |
equals(java.lang.Object obj)
Returns true if the DoubleKeyMapToList is equal to the given Object.
|
int |
firstKeyCount()
Returns the number of primary key maps contained by this
DoubleKeyMapToList.
|
java.util.Set<K1> |
getKeySet()
Returns a Set indicating the primary Keys of this DoubleKeyMapToList.
|
java.util.List<V> |
getListFor(K1 key1,
K2 key2)
Returns a copy of the List contained in this DoubleKeyMapToList for the
given keys.
|
java.util.Set<K2> |
getSecondaryKeySet(K1 key1)
Returns a Set of the secondary keys for the given primary key in this
DoubleKeyMapToList
NOTE: This method returns all of the secondary keys this
DoubleKeyMapToList contains for the given primary key.
|
int |
hashCode()
A consistent-with-equals hashCode for DoubleKeyMapToList.
|
boolean |
isEmpty()
Returns true if this DoubleKeyMapToList contains no Lists.
|
boolean |
removeFromListFor(K1 key1,
K2 key2,
V valueElement)
Removes the given value from the list for the given keys.
|
java.util.List<V> |
removeListFor(K1 key1,
K2 key2)
Removes the List for the given keys.
|
MapToList<K2,V> |
removeListsFor(K1 key1)
Removes the Lists for the given primary key.
|
int |
sizeOfListFor(K1 key1,
K2 key2)
Returns the number of objects in the List for the given keys.
|
public DoubleKeyMapToList()
public DoubleKeyMapToList(java.lang.Class<? extends java.util.Map> cl1, java.lang.Class<? extends java.util.Map> cl2)
cl1
- The Class to be used for the primary underlying mapcl2
- The Class to be used for the secondary underlying mapjava.lang.IllegalArgumentException
- if one or both of the given Classes is null or does not have
a public, zero argument constructor.public void addToListFor(K1 key1, K2 key2, V valueElement)
key1
- The primary key indicating which List the given object should
be added to.key2
- The secondary key indicating which List the given object
should be added to.valueElement
- The value to be added to the List for the given keys.public void addAllToListFor(K1 key1, K2 key2, java.util.Collection<V> values)
key1
- The primary key indicating which List the given objects should
be added to.key2
- The secondary key indicating which List the given objects
should be added to.values
- A Collection containing the items to be added to the List for
the given keys.public void addAll(DoubleKeyMapToList<K1,K2,V> dkmtl)
dkmtl
- The DoubleKeyMapToList from which the contents should be
copied into this DoubleKeyMapToList.public java.util.List<V> getListFor(K1 key1, K2 key2)
key1
- The primary key for retrieving the given Listkey2
- The secondary key for retrieving the given Listpublic boolean containsListFor(K1 key1)
key1
- The primary key for testing presence of a Listpublic boolean containsListFor(K1 key1, K2 key2)
key1
- The primary key for testing presence of a Listkey2
- The secondary key for testing presence of a Listpublic MapToList<K2,V> removeListsFor(K1 key1)
key1
- The primary key indicating the Lists to removepublic java.util.List<V> removeListFor(K1 key1, K2 key2)
key1
- The primary key indicating the List to removekey2
- The secondary key indicating the List to removepublic boolean removeFromListFor(K1 key1, K2 key2, V valueElement)
key1
- The primary key indicating which List the given object should
be removed fromkey2
- The secondary key indicating which List the given object
should be removed fromvalueElement
- The value to be removed from the List for the given keyspublic java.util.Set<K1> getKeySet()
public java.util.Set<K2> getSecondaryKeySet(K1 key1)
key1
- The primary key to retrieve keys for.public void clear()
public boolean isEmpty()
public int firstKeyCount()
public DoubleKeyMapToList<K1,K2,V> clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- (should not be thrown)Object.clone()
public boolean containsInList(K1 key1, K2 key2, V valueElement)
key1
- The primary key for retrieving the List to be checkedkey2
- The secondary key for retrieving the List to be checkedvalueElement
- The value to find in the List for the given keys.public int sizeOfListFor(K1 key1, K2 key2)
key1
- The primary key for retrieving the List to be checkedkey2
- The secondary key for retrieving the List to be checkedpublic int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)