|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.util.NtoNMap<Left,Right>
Left - Right - public class NtoNMap<Left,Right>
Class representing an N to N mapping. Similar to the java Map interface, but returns Collection's of values for each key instead of individual values.
| Constructor Summary | |
|---|---|
NtoNMap()
|
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsMapping(Left left,
Right right)
Returns true if the specified mapping exists |
Set<Left> |
getLefts()
Get all of the Lefts |
Collection<Left> |
getLefts(Right two)
Get all of the Lefts for the given Right |
Set<Right> |
getRights()
Get all of the Rights |
Collection<Right> |
getRights(Left one)
Get all of the Rights for the given Left |
boolean |
isEmpty()
Returns true if the size is 0 |
void |
put(Left leftElem,
Right rightElem)
Add the mapping to the map |
void |
putAll(NtoNMap<Left,Right> map)
Add all mappings from the given map |
boolean |
remove(Left left,
Right right)
Remove a mapping |
int |
size()
Get the number of unique mappings |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NtoNMap()
| Method Detail |
|---|
public void clear()
public void put(Left leftElem,
Right rightElem)
leftElem - rightElem - public void putAll(NtoNMap<Left,Right> map)
map - public Set<Left> getLefts()
public Collection<Left> getLefts(Right two)
two -
public Set<Right> getRights()
public Collection<Right> getRights(Left one)
one -
public boolean containsMapping(Left left,
Right right)
left - right -
public int size()
public boolean isEmpty()
public boolean remove(Left left,
Right right)
left - right -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||