jd.xml.xpath.object
Class XBoolean

java.lang.Object
  extended byjd.xml.xpath.object.XObject
      extended byjd.xml.xpath.object.XBoolean

public class XBoolean
extends XObject

XBoolean represents a XPath object with type boolean.


Field Summary
static XBoolean FALSE
          The XBoolean with value 'false'.
static XBoolean TRUE
          The XBoolean with value 'true'.
 
Fields inherited from class jd.xml.xpath.object.XObject
TYPE_BOOLEAN, TYPE_NODESET, TYPE_NUMBER, TYPE_STRING, TYPE_VARIABLE, TYPES
 
Method Summary
 int canConvertTo(Class javaClass)
          Test if the XObject can be converted to an object with the given class.
 boolean compare(Equality equality, double value)
          Return if this XObject equals the given value.
 boolean compare(Equality equality, String value)
          Return if this XObject equals the given value.
 boolean equals(Object obj)
          Test if the given object equals this object.
static XBoolean getBoolean(boolean value)
          Get a XBoolean for the given primitive boolean value.
 int getType()
          Return XObject.TYPE_BOOLEAN
 boolean toBooleanValue()
          Return the primitive boolean value of this XBoolean.
 double toNumberValue()
          Convert to a number.
static double toNumberValue(boolean b)
          Convert to a number.
 String toStringValue()
          Convert the value of this XBoolean as a string.
static String toStringValue(boolean b)
          Convert the boolean value to a string.
 Object toValue()
          Return a Boolean object representing the value of this XBoolean.
 Object toValue(Class javaClass)
          Convert the objects value to an object of the given class.
 
Methods inherited from class jd.xml.xpath.object.XObject
compare, compare, compare, compare, getTypeName, getTypeName, hashCode, toNodeSet, toString, toXObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final XBoolean TRUE
The XBoolean with value 'true'.


FALSE

public static final XBoolean FALSE
The XBoolean with value 'false'.

Method Detail

getBoolean

public static XBoolean getBoolean(boolean value)
Get a XBoolean for the given primitive boolean value.


getType

public int getType()
Return XObject.TYPE_BOOLEAN

Specified by:
getType in class XObject

toValue

public Object toValue()
Return a Boolean object representing the value of this XBoolean.

Specified by:
toValue in class XObject

toValue

public Object toValue(Class javaClass)
Convert the objects value to an object of the given class. If the conversion is not possible return null.

Specified by:
toValue in class XObject

canConvertTo

public int canConvertTo(Class javaClass)
Test if the XObject can be converted to an object with the given class.

Specified by:
canConvertTo in class XObject
Returns:
a positive integer if conversion is possible. The value indicates the conversion preference. A zero value indicates that conversion is not possible.

toBooleanValue

public boolean toBooleanValue()
Return the primitive boolean value of this XBoolean.

Specified by:
toBooleanValue in class XObject

toNumberValue

public double toNumberValue()
Convert to a number.

Specified by:
toNumberValue in class XObject

toNumberValue

public static double toNumberValue(boolean b)
Convert to a number.


toStringValue

public String toStringValue()
Convert the value of this XBoolean as a string.

Specified by:
toStringValue in class XObject

toStringValue

public static String toStringValue(boolean b)
Convert the boolean value to a string.


compare

public boolean compare(Equality equality,
                       String value)
Return if this XObject equals the given value.

Specified by:
compare in class XObject

compare

public boolean compare(Equality equality,
                       double value)
Return if this XObject equals the given value.

Overrides:
compare in class XObject

equals

public boolean equals(Object obj)
Test if the given object equals this object.

Overrides:
equals in class XObject