java.lang.Object | |
↳ | com.microstrategy.webapi.utils.BiMap<T1, T2> |
BiMap is a bi-directional map. It is intended to hold items, T1 and T2, that have a 1-1 relationship and it is desired to look up item T2 from T1 and look up T1 from T2. If a new item is inserted that already exists in the map the add will fail
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BiMap() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addT1(T1 iT1, T2 iT2)
addT1 puts the iT1 and iT2 into the internal bi-maps.
| ||||||||||
void |
clear()
clear will remove all entries in the bimaps
| ||||||||||
boolean |
containsT1(T1 iT1)
containsT1 return true is iT1 is in the bi-maps
| ||||||||||
boolean |
containsT2(T2 iT2)
containsT2 return true is iT2 is in the bi-maps
| ||||||||||
Set<Entry<T1, T2>> |
entrySet()
entrySet returns a Set of Entry objects from the bi-maps.
| ||||||||||
T2 | getByT1(T1 iT1) | ||||||||||
T1 | getByT2(T2 iT2) | ||||||||||
boolean | isEmpty() | ||||||||||
Entry<T1, T2> |
removeByT1(T1 iT1)
removeByT1 removes the entry in the bi-maps corresponding to iT1.
| ||||||||||
Entry<T1, T2> |
removeByT2(T2 iT2)
removeByT2 removes the entry in the bi-maps corresponding to iT2.
| ||||||||||
int | size() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
addT1 puts the iT1 and iT2 into the internal bi-maps. throws IllegalArgumentException if T1 or T2 already exist in the map
IllegalArgumentException |
---|
clear will remove all entries in the bimaps
containsT1 return true is iT1 is in the bi-maps
containsT2 return true is iT2 is in the bi-maps
entrySet returns a Set of Entry objects from the bi-maps. It is intended to be used when iterating over the bi-maps. It works very similarly (same syntax) as the HashMap.entrySet(). However, the returned Set is independent of the contents of the bi-map. Thus, if you modify the returned Set, you will NOT modify the underlying bi-maps
removeByT1 removes the entry in the bi-maps corresponding to iT1. Returns the entry of the map
removeByT2 removes the entry in the bi-maps corresponding to iT2. Returns the entry of the map