/** * Used by the {@link #parseExpression(NamespaceContext)} method * to build a {@link LocationPath} object from the accumulated * {@link Step}s. */ private LocationPath buildLocationPath( Vector stepsVector ) throws XPathException { int size = stepsVector.size(); check(size!=0); Step[] steps = new Step[size]; stepsVector.copyInto(steps); stepsVector.removeAllElements(); return new LocationPath(steps); }
/** Returns a string representation of this object. */ public String toString() { StringBuffer buf=new StringBuffer(); for (int i=0;i<fLocationPaths.length;i++){ if (i>0){ buf.append('|'); } buf.append(fLocationPaths[i].toString()); } return buf.toString(); } // toString():String
/** Returns a representation of the first location path for this XPath. */ public LocationPath getLocationPath() { return (LocationPath)fLocationPaths[0].clone(); } // getLocationPath(LocationPath)
/** Returns a clone of this object. */ public Object clone() { return new LocationPath(this); } // clone():Object
/** * Returns a representation of all location paths for this XPath. * XPath = locationPath ( '|' locationPath) */ public LocationPath[] getLocationPaths() { LocationPath[] ret=new LocationPath[fLocationPaths.length]; for (int i=0;i<fLocationPaths.length;i++){ ret[i]=(LocationPath)fLocationPaths[i].clone(); } return ret; } // getLocationPath(LocationPath)