|
JAPI 0.9.0 Yet another Java API API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.japi.util.Table<T1,T2>
public class Table<T1,T2>
A special Collection class that is like a Map but which allows duplicate keys. Only duplicate key/value pairs aren't allowed. The key therefor is named first, the value second. Uniqueness is gained with Key/Value pairs.
Constructor Summary | |
---|---|
Table()
Create a table. |
Method Summary | |
---|---|
void |
clear()
Completely Clear the table. |
Collection<T1> |
getFirstsBySecond(T2 second)
Get all firsts that match the second. |
Collection<Pair<T1,T2>> |
getPairsByFirst(T1 first)
Get all pairs that match the first. |
Collection<Pair<T1,T2>> |
getPairsBySecond(T2 second)
Get all pairs that match the second. |
Collection<T2> |
getSecondsByFirst(T1 first)
Get all seconds that match the first. |
boolean |
putPair(Pair<T1,T2> pair)
Put a pair into the table. |
boolean |
putPair(T1 t1,
T2 t2)
Put a pair into the table. |
boolean |
removeAllFirst(T1 first)
Remove all pairs that match a first. |
boolean |
removeAllSecond(T2 second)
Remove all pairs that match a second. |
boolean |
removePair(Pair<T1,T2> pair)
Remove a pair from the table. |
boolean |
removePair(T1 t1,
T2 t2)
Remove a pair into the table. |
int |
size()
Get the size of the table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Table()
Method Detail |
---|
public void clear()
public Collection<T1> getFirstsBySecond(T2 second)
second
- second to match
public Collection<Pair<T1,T2>> getPairsByFirst(T1 first)
first
- first to match
public Collection<Pair<T1,T2>> getPairsBySecond(T2 second)
second
- second to match
public Collection<T2> getSecondsByFirst(T1 first)
first
- first to match
public boolean putPair(Pair<T1,T2> pair)
pair
- pair to put into the table
true
if the table did not already contain that pair, otherwise false
public boolean putPair(T1 t1, T2 t2)
t1
- first of pairt2
- second of pair
true
if the table did not already contain that pair, otherwise false
public boolean removeAllFirst(T1 first)
first
- first to match
true
if at least one pair was removed, false
if no matching pairs were foundpublic boolean removeAllSecond(T2 second)
second
- second to match
true
if at least one pair was removed, false
if no matching pairs were foundpublic boolean removePair(Pair<T1,T2> pair)
pair
- pair to remove
true
if the table contained the pair, thus the pair was successfully removed, otherwise false
public boolean removePair(T1 t1, T2 t2)
t1
- first of pairt2
- second of pair
true
if the table did not already contain that pair, otherwise false
public int size()
|
JAPI Yet another Java API API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |