|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractMap | +--java.util.HashMap | +--edu.columbia.surge.hashImpl.FDH
This is the class that implements the FD interface and is inherited from the HashMap class. This is the base class that all kinds of FD will be inherrited from. It consists of methods to modify and to get the key-value pairs of the map of the FD. The toXML() method of this class has not be implemented due to time constraint. All kinds of FD such as Clause, Common, Proc... has to extend this class in order for the items to be able to hashed into the hashmap.
FD
, Serialized FormConstructor Summary | |
FDH()
Default constructor which creates a default instance of FDH. |
Method Summary | |
boolean |
checkPath(java.lang.String path)
A method to verify whether the given path exists in this FD. |
boolean |
checkPath(java.lang.String[] path)
A method to verify whether the path exists in this FD. |
protected java.lang.String |
computePathDifference(java.lang.String[] currentPath,
java.lang.String[] alreadyPrintedPath)
This method computes the difference between the current path and the path that is already printed and returns their difference. |
java.lang.Object |
getPath(java.lang.String path)
A method to return the object that associates with the given path. |
java.lang.Object |
getPath(java.lang.String[] path)
A method to return the object that associates with the given path. |
void |
putPath(java.lang.String[] path,
java.lang.Object newValue)
A method for user to put a new value object into the key of a FD that is specified by the given existing path. |
void |
putPath(java.lang.String path,
java.lang.Object newValue)
A method for user to put a new value object into the key of a FD that is specified by the given existing path. |
void |
putPathOverride(java.lang.String[] path,
java.lang.Object newValue)
A method for user to put a new value object associate with the key of a FD that is specified by the given existing path. |
void |
putPathOverride(java.lang.String path,
java.lang.Object newValue)
A method for user to put a new value object associate with the key of a FD that is specified by the given existing path. |
protected java.lang.String[] |
stackToPath(java.util.Stack stack)
A method that takes in a stack which stores the path names that the method has traversed to and convert the path into a string array. |
protected java.lang.String[] |
stringToArray(java.lang.String string)
A method that takes in a path string and return a path string array equivalent. |
java.lang.String |
toString()
Override the toString() method inherrited from HashMap, this method unifies the FD into its equivalent lisp-string representation by calling the private toString method. |
protected java.lang.String |
toString(java.util.Map alreadyPrinted,
java.util.Stack currentPath)
The private toString() method which constructs a lisp-string representation of the FD. |
java.lang.Object |
toXML()
A method to exports the FD in the form of XML. |
Methods inherited from class java.util.HashMap |
clear,
clone,
containsKey,
containsValue,
entrySet,
get,
isEmpty,
keySet,
put,
putAll,
remove,
size,
values |
Methods inherited from class java.util.AbstractMap |
equals,
hashCode |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public FDH()
Method Detail |
public java.lang.Object toXML() throws InvalidPathException
public void putPath(java.lang.String[] path, java.lang.Object newValue) throws InvalidPathException
path
- A path name which users specify the path to the
desired node with a String array which each elelemnt in the
path array will be the name of the node to be traversed.newValue
- A new value to be placed in the node of the
given pathpublic void putPath(java.lang.String path, java.lang.Object newValue) throws InvalidPathException
path
- A path name which users specify the path to the
desired node. The path is specified in one string with each
path separated by spaces.newValue
- A new value to be placed in the node of the
given pathputPath(String[] path, Object newValue)
,
stringToArray(String path)
public void putPathOverride(java.lang.String[] path, java.lang.Object newValue) throws InvalidPathException
path
- A path name which users specify the path to the
desired node with a String array which each elelemnt in the
path array will be the name of the node to be traversed.newValue
- A new value to be placed in the node of the given pathpublic void putPathOverride(java.lang.String path, java.lang.Object newValue) throws InvalidPathException
path
- A path name which users specify the path to the
desired node with a string which path names are separated by
spaces.newValue
- A new value to be placed in the node of the
given pathpublic boolean checkPath(java.lang.String[] path)
path
- the path to be verified, specified by a string
array with the names of the nodes of the path.public boolean checkPath(java.lang.String path)
path
- the path to be verified, specified by a string with
the names of the nodes of the path separated by spaces.stringToArray(String path)
,
checkPath(String[] path)
public java.lang.Object getPath(java.lang.String[] path) throws InvalidPathException
path
- the path of the object to be retrieved, specified
in a string array that stores each path node name.public java.lang.Object getPath(java.lang.String path) throws InvalidPathException
path
- the path of the object to be retrieved, specified
in a string array that stores each path node name.stringToArray(String path)
,
getPath(String[] path)
public java.lang.String toString()
toString(Map alreadyPrinted, Stack currentPath)
protected java.lang.String toString(java.util.Map alreadyPrinted, java.util.Stack currentPath)
alreadyPrinted
- a HashMap that keeps track of the FD that
is already printed and processedcurrentPath
- a stack which keeps track of the current
path that the method traversesprotected java.lang.String computePathDifference(java.lang.String[] currentPath, java.lang.String[] alreadyPrintedPath)
currentPath
- the current path that it has traversed toalreadyPrintedPath
- the path that is already printedtoString(Map alreadyPrinted, Stack currentPath)
protected java.lang.String[] stackToPath(java.util.Stack stack)
a
- stack which stores all the path namestoString(Map alreadyPrinted, Stack currentPath)
protected java.lang.String[] stringToArray(java.lang.String string)
string
- the path string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |