|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--edu.wpi.cs.dsrg.utils.BindingTable
This class defines the BindingTable, which is used to represent variable binding within the tree.
Constructor Summary | |
BindingTable()
The default BindingTable constructor. |
|
BindingTable(int initialCapacity)
The BindingTable constructor using given capacity. |
|
BindingTable(int initialCapacity,
float loadFactor)
The BindingTable constructor. |
|
BindingTable(java.util.Map t)
The BindingTable constructor. |
Method Summary | |
NavigationStep[] |
computeSimplifiedFullPath(java.lang.String key)
Compute the full path of a given variable. |
boolean |
contains(java.lang.String key)
Check if a value exists in the hashtable |
java.lang.Object |
get(java.lang.Object key)
Deprecated. You should use getVariableValue(...) instead. Note: Disable the usage of the original get() outside of this class. |
java.util.Vector |
getChain(java.lang.String key)
It will get all the VarStep alone this Key in the binding table. |
java.util.Vector |
getChainRecursive(java.lang.String key)
Get all the VarStep alone this Key in the binding table. |
java.lang.String |
getKeyByValue(java.lang.String value)
Get the key by the variable binding. |
java.lang.String |
getKeyByXMLValue(java.lang.String value)
Given an XML path, plus "/SOURCE", return the Key as a string |
java.util.Vector |
getKeysByXMLValue(java.lang.String value)
Given an XML path, plus "/SOURCE", return the Key as a string If more than one mapping can exist, use the method that returns a vector |
static java.lang.String |
getTagValue(java.lang.String element)
Get the tag value from an open/close tag of an XML element. |
NavigationStep[] |
getVariableValue(java.lang.String varName)
Accepts a string varName and returns the path that it represents according to the variableTable. |
NavigationStep[] |
getVariableValue(java.lang.String varName,
boolean recursiveLookup)
Accepts a string varName and returns the path that it represents according to the this. |
protected NavigationStep[] |
getVariableValueRecursive(java.lang.String varName,
boolean recursiveLookup)
Accepts a string varName and returns the path that it represents according to the this. |
java.lang.String |
navStepsToString(NavigationStep[] steps)
Convert a NavigationStep into String. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Deprecated. You should use updateVariableTable(..,..) instead. |
void |
replaceKey(java.lang.String newKey,
java.lang.String oldKey)
Replace ALL the occurances of the oldKey with the newKey. |
java.lang.String |
simpleToXMLString(NavigationStep[] steps)
Take a set of Navigation steps, and produce a XML path, minus text This method is useful for getKeyByXMLValue(). |
java.lang.String |
toString()
Convert BindingTable into a String. |
java.lang.String |
toString(boolean fullpath)
Output the String format of this BindingTable. |
void |
updateVariableTable(java.lang.String oldKey,
ListPattern newBinding)
Put a listPattern into the binding table by converting the pattern into navigation steps. |
void |
updateVariableTable(java.lang.String oldKey,
NavigationStep[] newBinding)
Remove the entry for oldKey and make it bound to binding |
void |
updateVariableTable(java.lang.String newKey,
java.lang.String oldKey)
Make whatever is bound to the oldKey to be bound to the newKey |
void |
updateVariableTable(java.lang.String oldKey,
java.util.Vector newBinding)
Remove the entry for oldKey and make it bound to binding |
Methods inherited from class java.util.Hashtable |
clear,
clone,
contains,
containsKey,
containsValue,
elements,
entrySet,
equals,
hashCode,
isEmpty,
keys,
keySet,
putAll,
rehash,
remove,
size,
values |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public BindingTable()
public BindingTable(int initialCapacity)
initialCapacity
- The capacity of the BindingTable.public BindingTable(int initialCapacity, float loadFactor)
initialCapacity
- The capacity of the BindingTable.loadFactor
- floatpublic BindingTable(java.util.Map t)
t
- The Map for BindingTable.Method Detail |
public NavigationStep[] computeSimplifiedFullPath(java.lang.String key)
Key
- The given variable computing path for.public boolean contains(java.lang.String key)
key
- The variable looking for.public java.lang.Object get(java.lang.Object key)
key
- The key of the variable binding looking for.public java.util.Vector getChain(java.lang.String key)
key
- The Key searching for.public java.util.Vector getChainRecursive(java.lang.String key)
key
- The Key searching for.public java.lang.String getKeyByValue(java.lang.String value)
value
- The value searching for.public java.lang.String getKeyByXMLValue(java.lang.String value)
value
- An XML path.public java.util.Vector getKeysByXMLValue(java.lang.String value)
value
- The XML value searching for.public static java.lang.String getTagValue(java.lang.String element)
element
- The XML element searching for.public NavigationStep[] getVariableValue(java.lang.String varName)
varName
- The variable looking up.public NavigationStep[] getVariableValue(java.lang.String varName, boolean recursiveLookup)
varName
- containing the variable to look up.protected NavigationStep[] getVariableValueRecursive(java.lang.String varName, boolean recursiveLookup)
varName
- containing the variable to look up.public java.lang.String navStepsToString(NavigationStep[] steps)
steps
- The NavigationStep array converting for.public java.lang.Object put(java.lang.Object key, java.lang.Object value)
public void replaceKey(java.lang.String newKey, java.lang.String oldKey)
newKey
- The old key replaced.oldKey
- The new key replacing.public java.lang.String simpleToXMLString(NavigationStep[] steps)
steps
- The source NavigationStep[].public java.lang.String toString()
public java.lang.String toString(boolean fullpath)
fullpath
- True: output the fullpath of variable binding. False: otherwise.public void updateVariableTable(java.lang.String oldKey, NavigationStep[] newBinding)
newBinding
- The new variable binding for given key.oldKey
- The key of the variable which will be replaced.public void updateVariableTable(java.lang.String oldKey, ListPattern newBinding)
newBinding
- The new variable binding for given key.oldKey
- The key of the variable which will be replaced.public void updateVariableTable(java.lang.String newKey, java.lang.String oldKey)
newkey
- The new variable binding for given key.oldKey
- The key of the variable which will be replaced.public void updateVariableTable(java.lang.String oldKey, java.util.Vector newBinding)
newBinding
- The new variable binding for given key.oldKey
- The key of the variable which will be replaced.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |