org.exolab.adaptx.xslt
Class TreeFragmentResult

java.lang.Object
  extended by org.exolab.adaptx.xpath.XPathResult
      extended by org.exolab.adaptx.xslt.XSLTFunctionResult
          extended by org.exolab.adaptx.xslt.TreeFragmentResult
All Implemented Interfaces:
java.io.Serializable

public class TreeFragmentResult
extends XSLTFunctionResult

Represents a TreeFragment result

Version:
$Revision: 4092 $ $Date: 2004-01-26 18:43:54 -0500 (Mon, 26 Jan 2004) $
Author:
Keith Visco
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.exolab.adaptx.xslt.XSLTFunctionResult
TREE_FRAGMENT
 
Fields inherited from class org.exolab.adaptx.xpath.XPathResult
BOOLEAN, NODE_SET, NUMBER, STRING, USER_DEFINED
 
Constructor Summary
TreeFragmentResult()
          Creates a new TreeFragmentResult that represents a "empty" fragment.
TreeFragmentResult(NodeSet nodes)
          Creates a new TreeFragmentResult with the given NodeSet.
TreeFragmentResult(XPathNode node)
          Creates a new TreeFragmentResult with the given XPathNode.
 
Method Summary
 boolean booleanValue()
          Returns the value of this ExprResult as a boolean
 boolean equals(XPathResult result)
          Returns true if the given expression is the same tyoe as this result and has the same value as this result.
 NodeSet getValue()
          Returns the value of this TreeFragmentResult
 short getXSLTResultType()
          Returns the type of this result.
 java.lang.Object javaObject()
          Returns the Result as a Java Object.
 double numberValue()
          Returns the value of this XPathResult as a double
 void setValue(NodeSet nodes)
          Sets the value of this TreeFragmentResult
 void setValue(XPathNode node)
          Sets the value of this TreeFragmentResult
 java.lang.String stringValue()
          Returns the result as a string value.
 java.lang.String toString()
           
 
Methods inherited from class org.exolab.adaptx.xslt.XSLTFunctionResult
getResultType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeFragmentResult

public TreeFragmentResult()
Creates a new TreeFragmentResult that represents a "empty" fragment.


TreeFragmentResult

public TreeFragmentResult(XPathNode node)
Creates a new TreeFragmentResult with the given XPathNode.

Parameters:
node - the XPathNode which is the "tree fragment".

TreeFragmentResult

public TreeFragmentResult(NodeSet nodes)
Creates a new TreeFragmentResult with the given NodeSet.

Parameters:
nodes - the NodeSet which is the "tree fragment".
Method Detail

getValue

public NodeSet getValue()
Returns the value of this TreeFragmentResult

Returns:
the value of this TreeFragmentResult

setValue

public void setValue(XPathNode node)
Sets the value of this TreeFragmentResult

Parameters:
node - the XPathNode to use as the result fragment

setValue

public void setValue(NodeSet nodes)
Sets the value of this TreeFragmentResult

Parameters:
nodes - the NodeSet to use as the result fragment

getXSLTResultType

public short getXSLTResultType()
Returns the type of this result.

Specified by:
getXSLTResultType in class XSLTFunctionResult
Returns:
The type of this result

booleanValue

public boolean booleanValue()
Returns the value of this ExprResult as a boolean

Specified by:
booleanValue in class XSLTFunctionResult
Returns:
the value of this ExprResult as a boolean

equals

public boolean equals(XPathResult result)
Returns true if the given expression is the same tyoe as this result and has the same value as this result.

Specified by:
equals in class XSLTFunctionResult
Parameters:
result - An XPath result
Returns:
True if same type and same value as this result

numberValue

public double numberValue()
Returns the value of this XPathResult as a double

Specified by:
numberValue in class XSLTFunctionResult
Returns:
the value of this XPathResult as a double

javaObject

public java.lang.Object javaObject()
Returns the Result as a Java Object. For tree-fragment this is simply an XPathNode.

Specified by:
javaObject in class XSLTFunctionResult
Returns:
the Result as a Java Object

stringValue

public java.lang.String stringValue()
Returns the result as a string value. Returns "false" or "true" for a boolean result, the value of a string result, the string value of a number result, or the string value of a node-set.

Specified by:
stringValue in class XSLTFunctionResult
Returns:
The result as a string value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object