Package edu.stanford.nlp.util
Class OneToOneMap<L,R>
- java.lang.Object
-
- edu.stanford.nlp.util.OneToOneMap<L,R>
-
- Type Parameters:
L- keys on the leftR- keys on the right
- All Implemented Interfaces:
Serializable
public class OneToOneMap<L,R> extends Object implements Serializable
One to one map that allows to get a value for a key and a key for a value in O(1).- Author:
- jonathanberant
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOneToOneMap.OneToOneMapException
-
Constructor Summary
Constructors Constructor Description OneToOneMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsLeftAsKey(L l)booleancontainsRightAsKey(R r)Set<Map.Entry<L,R>>entrySetLeftAsKey()Set<Map.Entry<R,L>>entrySetRightAsKey()RgetLeftAsKey(L l)LgetRightAsKey(R r)booleanisEmpty()voidput(L l, R r)RremoveLeftAsKey(L l)LremoveRightAsKey(R r)intsize()Collection<R>valuesLeftAsKey()Collection<L>valuesRightAsKey()
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
put
public void put(L l, R r) throws OneToOneMap.OneToOneMapException
- Throws:
OneToOneMap.OneToOneMapException
-
valuesLeftAsKey
public Collection<R> valuesLeftAsKey()
-
valuesRightAsKey
public Collection<L> valuesRightAsKey()
-
containsLeftAsKey
public boolean containsLeftAsKey(L l)
-
containsRightAsKey
public boolean containsRightAsKey(R r)
-
clear
public void clear()
-
-