com.ibm.tspaces.xtuples
Class SubPath

java.lang.Object
  |
  +--com.ibm.tspaces.xtuples.SubPath

public class SubPath
extends java.lang.Object

The SubPath class encapsulates a single path node in the path expression of the XQuery. Here is the list of components inside an SubPath 1. boolean wildcard - is this subpath a wildcard 2. boolean descendant - is this subpath a "//" 3. String tagname 4. String value 5. Vector attributes

Author:
Ben Y. Zhao
See Also:
XQuery, XQueryImpl, XTuple, TupleTree, XTupleException

Constructor Summary
SubPath(boolean snip)
          If the subpath node is just a "//", then this constructor sets that flag.
SubPath(java.lang.String pathString)
          Converts a pathString excerpt to an encapsulation of the XQL constructs.
 
Method Summary
 java.util.Vector getAttributes()
          Access method for the attribute constraints.
 java.lang.String getTagName()
          Access method for the tagname of the subpath node.
 java.lang.String getTagValue()
          Access method for the tag value of the subpath node.
 boolean isDescendant()
          Access method for descendant
 boolean isWild()
          Returns whether the pathnode is a wildcard
static void main(java.lang.String[] argv)
           
 java.lang.String toString()
          The method that prints out the contents of the subpath node in a pretty format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubPath

public SubPath(java.lang.String pathString)
        throws XTupleException
Converts a pathString excerpt to an encapsulation of the XQL constructs. Currently handles multiple constraints, but each constraint must be an attribute value at this point. It also supports "//" values, known as descendants, "*" values, known as wildcards, and normal tag name-value pairs.

Parameters:
pathString - The string to be converted

SubPath

public SubPath(boolean snip)
If the subpath node is just a "//", then this constructor sets that flag.
Parameters:
snip - is the true boolean value if the subpath node is a "//"
Method Detail

isWild

public boolean isWild()
Returns whether the pathnode is a wildcard
Returns:
whether the node is a wildcard node

isDescendant

public boolean isDescendant()
Access method for descendant
Returns:
whether the path node

getTagName

public java.lang.String getTagName()
Access method for the tagname of the subpath node.
Returns:
The string tag name inside this subpath

getTagValue

public java.lang.String getTagValue()
Access method for the tag value of the subpath node.
Returns:
The string tag value inside this subpath

getAttributes

public java.util.Vector getAttributes()
Access method for the attribute constraints. The method returns the actual vector, meaning that users can actually modify the contents of the vector to alter the constraints.
Returns:
the vector containing the attribute constraints

toString

public java.lang.String toString()
The method that prints out the contents of the subpath node in a pretty format
Overrides:
toString in class java.lang.Object
Returns:
string output of the contents of the subpath node

main

public static void main(java.lang.String[] argv)