|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.tum.cs.commons.collections.BidirectionalMap<S,T>
public class BidirectionalMap<S,T>
A collection which implements a bidirectional mapping.
| Constructor Summary | |
|---|---|
BidirectionalMap()
Creates new bidirectional map based on hash maps. |
|
BidirectionalMap(Map<S,T> stMap,
Map<T,S> tsMap)
Creates new bidirectional map based given maps. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the map. |
boolean |
containsFirst(S s)
Returns whether the given element is in the first set (the domain of the bijection). |
boolean |
containsSecond(T t)
Returns whether the given element is in the second set (the range of the bijection). |
UnmodifiableSet<Map.Entry<S,T>> |
getEntrySet()
Returns the entries. |
S |
getFirst(T t)
Get first element. |
UnmodifiableSet<S> |
getFirstSet()
Returns the first set (the domain). |
UnmodifiableSet<Map.Entry<T,S>> |
getInvertedEntrySet()
Returns the inverted entries. |
T |
getSecond(S s)
Get second element. |
UnmodifiableSet<T> |
getSecondSet()
Returns the second set (the range). |
boolean |
isEmpty()
Returns whether this map is empty. |
void |
put(S s,
T t)
Inserts the given pair into the bijection. |
void |
removeFirst(S s)
Removes the first object |
void |
removeSecond(T t)
Removes the second object |
int |
size()
Returns the size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BidirectionalMap()
public BidirectionalMap(Map<S,T> stMap,
Map<T,S> tsMap)
| Method Detail |
|---|
public S getFirst(T t)
public T getSecond(S s)
public boolean isEmpty()
public int size()
public void clear()
public boolean containsFirst(S s)
public boolean containsSecond(T t)
public UnmodifiableSet<S> getFirstSet()
public UnmodifiableSet<T> getSecondSet()
public UnmodifiableSet<Map.Entry<S,T>> getEntrySet()
public UnmodifiableSet<Map.Entry<T,S>> getInvertedEntrySet()
public void put(S s,
T t)
public void removeFirst(S s)
public void removeSecond(T t)
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||