org.hypergraphdb.util
Class TwoWayMap<X,Y>
java.lang.Object
org.hypergraphdb.util.TwoWayMap<X,Y>
- Type Parameters:
X - Y -
public class TwoWayMap<X,Y>
- extends java.lang.Object
A bi-directional map X <-> Y. For lack of better terms
(yes, we considered "domain" and "range") the map is between a set of
Xs and a set of Ys.
Note that this class is not thread-safe.
- Author:
- Borislav Iordanov
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TwoWayMap
public TwoWayMap()
add
public void add(X x,
Y y)
xiterator
public java.util.Iterator<X> xiterator()
yiterator
public java.util.Iterator<Y> yiterator()
xyiterator
public java.util.Iterator<Pair<X,Y>> xyiterator()
removeX
public Y removeX(X x)
removeY
public X removeY(Y y)
getY
public Y getY(X x)
getX
public X getX(Y y)
containsX
public boolean containsX(X x)
containsY
public boolean containsY(Y y)
isEmtpy
public boolean isEmtpy()
clear
public void clear()