|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.Gridtable
public class Gridtable
A two-dimensional map. That is, a collection of non-null objects indexed by 2 keys.
Field Summary | |
---|---|
static java.lang.String |
ClassName
|
Constructor Summary | |
---|---|
Gridtable()
|
Method Summary | |
---|---|
void |
clear()
Clear all elements from this table. |
boolean |
containsPrimaryKey(java.lang.Object key1)
Returns whether the grid table contains the primary key key1 . |
java.lang.Object[] |
elementsArray()
Returns all unique objects in the Gridtable as an array. |
java.util.List |
elementsList()
Returns all unique objects in the Gridtable as an array. |
java.lang.Object |
get(java.lang.Object key1,
java.lang.Object key2)
Return the element indexed by |
static java.lang.Object |
lookupKey(java.util.List keys,
java.lang.Object key,
Compare compare)
Looks at the given list of keys to find one that matches the specified key, using the given compare function. |
Gridtable |
pivot()
Returns a new Gridtable, with the primary and secondary keys swapped. |
java.util.Iterator |
primaryKeys()
Returns the primary keys. |
java.lang.Object |
put(java.lang.Object key1,
java.lang.Object key2,
java.lang.Object element)
Store the specified element indexed by |
java.util.Map |
remove(java.lang.Object key1)
Remove a key from the first dimension of the grid. |
java.lang.Object |
remove(java.lang.Object key1,
java.lang.Object key2)
Remove a key from the specified cell of the grid. |
java.util.List |
secondaryElementsList(java.lang.Object primaryKey)
Returns unique objects in the gridtable as a list given a primary key. |
java.util.Iterator |
secondaryKeys(java.lang.Object key1)
Returns a vector containing the secondary keys, given a primary key. |
void |
setPrimaryKeyCompare(Compare c)
Squirrel away a default compare object for sorting the primary keys. |
void |
setSecondaryKeyCompare(Compare c)
Squirrel away a default compare object for sorting the secondary keys. |
int |
size()
|
java.util.Iterator |
sortedPrimaryKeys()
Returns the primary keys, in sorted order. |
java.util.Iterator |
sortedPrimaryKeys(Compare c)
Returns the primary keys, in sorted order. |
java.util.List |
sortedPrimaryKeysList()
|
java.util.List |
sortedPrimaryKeysList(Compare c)
|
java.util.Iterator |
sortedSecondaryKeys(java.lang.Object key1)
Returns an array containing the secondary keys, given a primary key. |
java.util.Iterator |
sortedSecondaryKeys(java.lang.Object key1,
Compare c)
Returns an array containing the secondary keys, given a primary key. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ClassName
Constructor Detail |
---|
public Gridtable()
Method Detail |
---|
public void setPrimaryKeyCompare(Compare c)
public void setSecondaryKeyCompare(Compare c)
public java.lang.Object put(java.lang.Object key1, java.lang.Object key2, java.lang.Object element)
java.lang.NullPointerException
- if element or
key1 or key2 are nullpublic java.lang.Object get(java.lang.Object key1, java.lang.Object key2)
java.lang.NullPointerException
- if key1 or
key2 are nullpublic java.util.Map remove(java.lang.Object key1)
key1
- The key to remove
java.lang.NullPointerException
- if key1 is nullpublic java.lang.Object remove(java.lang.Object key1, java.lang.Object key2)
key1
- The first dimension of the gridkey2
- The second dimension of the grid
java.lang.NullPointerException
- if
key1 or key2 are nullpublic void clear()
public int size()
public java.util.Iterator primaryKeys()
public boolean containsPrimaryKey(java.lang.Object key1)
key1
.
key1
- the primary key to check against
key1
public java.util.Iterator sortedPrimaryKeys()
public java.util.Iterator sortedPrimaryKeys(Compare c)
public java.util.List sortedPrimaryKeysList()
public java.util.List sortedPrimaryKeysList(Compare c)
public static java.lang.Object lookupKey(java.util.List keys, java.lang.Object key, Compare compare)
public java.util.Iterator secondaryKeys(java.lang.Object key1)
public java.util.Iterator sortedSecondaryKeys(java.lang.Object key1)
public java.util.Iterator sortedSecondaryKeys(java.lang.Object key1, Compare c)
public java.lang.Object[] elementsArray()
public java.util.List secondaryElementsList(java.lang.Object primaryKey)
public java.util.List elementsList()
public Gridtable pivot()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |