|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xanot.util.StackMap<SK,SV>
public class StackMap<SK,SV>
A stack that support object to object mapping.
Nested Class Summary | |
---|---|
(package private) class |
StackMap.MapElement<K,V>
Inner class. |
Constructor Summary | |
---|---|
StackMap()
|
Method Summary | |
---|---|
boolean |
containsKey(SK key)
Check wether a key is already inside the stack map. |
boolean |
containsValue(SV value)
Check wether a value is already inside the stack map. |
SK |
getKey(int idx)
Get the key of the map at specified index. |
java.util.ArrayList<SK> |
getKeyPath()
Get path of Key |
java.lang.String |
getStringKeyPath()
Get key path as string path. |
SV |
getValue(int idx)
Get the value of the map at specified index. |
java.util.ArrayList<SV> |
getValuePath()
Get path of Value |
boolean |
isApplicableForPath(java.lang.String path)
An additional method tocheck wether this stack is applicable for a specific path like data. |
SK |
peekParentKey()
Get the key of map right below the top-most stack. |
SV |
peekParentValue()
Get the value of map right below the top-most stack. |
StackMap.MapElement<SK,SV> |
pop()
Get and remove the map on top of the stack. |
void |
push(SK key,
SV value)
Add new map on top of the stack. |
int |
size()
DOCUMENT ME! |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StackMap()
Method Detail |
---|
public int size()
public boolean isApplicableForPath(java.lang.String path)
An additional method tocheck wether this stack is applicable for a specific path like data.
For example :
Stack Key
+---+---+---+-----
| a | b | c | <--push -->pop
+---+---+---+-----
Is applicable to :
"/a/b/c" or "../a/b/c" or
"../b/c" or "../c" or even just ".."
Not applicable to :
"/1/b/c" or "/1/a/b/c" or
"../1/b/c" or an empty string ""
- Parameters:
path
- Path string
- Returns:
- True if the path is applicable to the stack. False if otherwise.
public void push(SK key, SV value)
key
- Key objectvalue
- Value objectpublic StackMap.MapElement<SK,SV> pop()
public java.lang.String getStringKeyPath()
public java.util.ArrayList<SK> getKeyPath()
public java.util.ArrayList<SV> getValuePath()
public SV getValue(int idx)
idx
- Index.
public SK getKey(int idx)
idx
- Index
public SV peekParentValue()
public SK peekParentKey()
public boolean containsKey(SK key)
key
- Key to check
public boolean containsValue(SV value)
value
- Value to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |