public class

TriMap

extends Object
java.lang.Object
   ↳ com.microstrategy.webapi.utils.TriMap<T1, T2, T3>

Class Overview

TriMap is a triple-directional map. It is intended to hold items, T1, T2, and T3, that have a 1-1 relationship and it is desired to look up item T1 from T2 or T3, T2 from T1 or T2, or T3 from T1 or T2. If a new item is inserted that already exists in the map the add will fail

Summary

Nested Classes
class TriMap.Entry<T1, T2, T3>  
Public Constructors
TriMap()
Public Methods
void addT1(T1 iT1, T2 iT2, T3 iT3)
addT1 puts the iT1, iT2, and iT3 into the internal tri-maps.
void clear()
clear will remove all entries in the tri-maps
boolean containsT1(T1 iT1)
containsT1 return true is iT1 is in the tri-maps
boolean containsT2(T2 iT2)
containsT2 return true is iT2 is in the tri-maps
boolean containsT3(T3 iT3)
containsT2 return true is iT2 is in the tri-maps
Set<Entry<T1, T2, T3>> entrySet()
entrySet returns a Set of Entry objects from the tri-maps.
Entry<T1, T2, T3> getByT1(T1 iT1)
Entry<T1, T2, T3> getByT2(T2 iT2)
Entry<T1, T2, T3> getByT3(T3 iT3)
boolean isEmpty()
Entry<T1, T2, T3> removeByT1(T1 iT1)
removeByT1 removes the entry in the tri-maps corresponding to iT1.
Entry<T1, T2, T3> removeByT2(T2 iT2)
removeByT2 removes the entry in the tri-maps corresponding to iT2.
Entry<T1, T2, T3> removeByT3(T3 iT3)
removeByT3 removes the entry in the tri-maps corresponding to iT3.
int size()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TriMap ()

Public Methods

public void addT1 (T1 iT1, T2 iT2, T3 iT3)

addT1 puts the iT1, iT2, and iT3 into the internal tri-maps. throws IllegalArgumentException if T1, T2, or T3 already exist in the map

Throws
IllegalArgumentException

public void clear ()

clear will remove all entries in the tri-maps

public boolean containsT1 (T1 iT1)

containsT1 return true is iT1 is in the tri-maps

public boolean containsT2 (T2 iT2)

containsT2 return true is iT2 is in the tri-maps

public boolean containsT3 (T3 iT3)

containsT2 return true is iT2 is in the tri-maps

public Set<Entry<T1, T2, T3>> entrySet ()

entrySet returns a Set of Entry objects from the tri-maps. It is intended to be used when iterating over the tri-maps. It works very similarly (same syntax) as the HashMap.entrySet(). However, the returned Set is independent of the contents of the tri-map. Thus, if you modify the returned Set, you will NOT modify the underlying tri-maps

public Entry<T1, T2, T3> getByT1 (T1 iT1)

public Entry<T1, T2, T3> getByT2 (T2 iT2)

public Entry<T1, T2, T3> getByT3 (T3 iT3)

public boolean isEmpty ()

public Entry<T1, T2, T3> removeByT1 (T1 iT1)

removeByT1 removes the entry in the tri-maps corresponding to iT1. Returns the entry of the map

public Entry<T1, T2, T3> removeByT2 (T2 iT2)

removeByT2 removes the entry in the tri-maps corresponding to iT2. Returns the entry of the map

public Entry<T1, T2, T3> removeByT3 (T3 iT3)

removeByT3 removes the entry in the tri-maps corresponding to iT3. Returns the entry of the map

public int size ()