|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.util.Map2D
public class Map2D
This class is used to store Objects in a map with 2 keys, used very heavily in the TimespanAnalyser. For each combination of 2 (ordered) keys, one entry can exist, just as with the usual Map. So, this is something like a very inefficient matrix, bad for performance, good for flexible construction and access. Width and height information is not really correct: width returns the number of keys that have been used as columnkeys, even if some of those keys are no longer in use. (and the same for height). Only if you call clear() will this information be flushed and will w/h again be 0/0. But then your matrix is empty :) Too bad, but since I don't need the correct w/h information now, I'm not going to fix it. Anybody feels like, go ahead!
Constructor Summary | |
---|---|
Map2D()
|
Method Summary | |
---|---|
void |
clear()
|
java.util.Set |
columnKeySet()
returns all columnkeys in the tree |
boolean |
containsRowKey(java.lang.String key)
|
java.lang.String |
dumpToString()
For debug: dump the matrix to text. |
java.lang.Object |
get(java.lang.Object rowKey,
java.lang.Object columnKey)
returns the value in the Map2D for the given two keys. |
int |
height()
|
java.lang.Object |
put(java.lang.Object rowKey,
java.lang.Object columnKey,
java.lang.Object value)
Add a value to the Map2D for the given two keys. |
java.lang.Object |
remove(java.lang.Object rowKey,
java.lang.Object columnKey)
Removes all entries for the given key |
void |
removeRow(java.lang.Object rowKey)
Removes all entries in the given row |
java.util.Set |
rowKeySet()
returns all rowkeys in the tree |
int |
width()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Map2D()
Method Detail |
---|
public java.lang.Object put(java.lang.Object rowKey, java.lang.Object columnKey, java.lang.Object value)
public java.lang.Object get(java.lang.Object rowKey, java.lang.Object columnKey)
public void clear()
public java.util.Set rowKeySet()
public java.util.Set columnKeySet()
public boolean containsRowKey(java.lang.String key)
public java.lang.Object remove(java.lang.Object rowKey, java.lang.Object columnKey)
public void removeRow(java.lang.Object rowKey)
public int width()
public int height()
public java.lang.String dumpToString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |