org.exist.xquery.value
Class BooleanValue

java.lang.Object
  extended by org.exist.xquery.value.AtomicValue
      extended by org.exist.xquery.value.BooleanValue
All Implemented Interfaces:
Comparable, Indexable, Item, Sequence

public class BooleanValue
extends AtomicValue


Field Summary
static BooleanValue FALSE
           
static BooleanValue TRUE
           
 
Fields inherited from class org.exist.xquery.value.AtomicValue
EMPTY_VALUE
 
Fields inherited from interface org.exist.xquery.value.Sequence
EMPTY_SEQUENCE
 
Constructor Summary
BooleanValue(boolean bool)
           
 
Method Summary
 int compareTo(Collator collator, AtomicValue other)
           
 boolean compareTo(Collator collator, int operator, AtomicValue other)
           
 int compareTo(Object o)
           
 int conversionPreference(Class javaClass)
          Returns a preference indicator, indicating the preference of a value to be converted into the given Java class.
 AtomicValue convertTo(int requiredType)
          Convert this item into an atomic value, whose type corresponds to the specified target type.
 boolean effectiveBooleanValue()
          Get the effective boolean value of this sequence.
 String getStringValue()
          Return the string value of this item (see the definition of string value in XPath).
 int getType()
          Returns the type of the Indexable as one of the constants defined in Type.
 boolean getValue()
           
 AtomicValue max(Collator collator, AtomicValue other)
           
 AtomicValue min(Collator collator, AtomicValue other)
           
 Object toJavaObject(Class target)
          Convert the value into an instance of the specified Java class.
static BooleanValue valueOf(boolean bool)
          Returns one of the static fields TRUE or FALSE depending on the value of the parameter.
 
Methods inherited from class org.exist.xquery.value.AtomicValue
add, addAll, atomize, clearContext, contains, copyTo, dump, endsWith, getCardinality, getCollectionIterator, getDocumentSet, getItemCount, getItemType, getState, hasChanged, hasMany, hasOne, isCacheable, isCached, isEmpty, isPersistentSet, itemAt, iterate, nodeMoved, promote, removeDuplicates, serializeValue, setIsCached, setSelfAsContext, startsWith, toMemNodeSet, toNodeSet, toSAX, toSequence, toString, unorderedIterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final BooleanValue TRUE

FALSE

public static final BooleanValue FALSE
Constructor Detail

BooleanValue

public BooleanValue(boolean bool)
Method Detail

valueOf

public static final BooleanValue valueOf(boolean bool)
Returns one of the static fields TRUE or FALSE depending on the value of the parameter.

Parameters:
bool -

getType

public int getType()
Description copied from interface: Indexable
Returns the type of the Indexable as one of the constants defined in Type.

Specified by:
getType in interface Indexable
Specified by:
getType in interface Item
Overrides:
getType in class AtomicValue
Returns:
Type of the Indexable

getStringValue

public String getStringValue()
                      throws XPathException
Description copied from interface: Item
Return the string value of this item (see the definition of string value in XPath).

Specified by:
getStringValue in interface Item
Specified by:
getStringValue in interface Sequence
Specified by:
getStringValue in class AtomicValue
Throws:
XPathException

convertTo

public AtomicValue convertTo(int requiredType)
                      throws XPathException
Description copied from interface: Item
Convert this item into an atomic value, whose type corresponds to the specified target type. requiredType should be one of the type constants defined in Type. An XPathException is thrown if the conversion is impossible.

Specified by:
convertTo in interface Item
Specified by:
convertTo in interface Sequence
Specified by:
convertTo in class AtomicValue
Parameters:
requiredType - one of the type constants defined in class Type
Throws:
XPathException

compareTo

public boolean compareTo(Collator collator,
                         int operator,
                         AtomicValue other)
                  throws XPathException
Specified by:
compareTo in class AtomicValue
Throws:
XPathException

compareTo

public int compareTo(Collator collator,
                     AtomicValue other)
              throws XPathException
Specified by:
compareTo in class AtomicValue
Throws:
XPathException

effectiveBooleanValue

public boolean effectiveBooleanValue()
                              throws XPathException
Description copied from interface: Sequence
Get the effective boolean value of this sequence. Will be false if the sequence is empty, true otherwise.

Specified by:
effectiveBooleanValue in interface Sequence
Specified by:
effectiveBooleanValue in class AtomicValue
Throws:
XPathException

getValue

public boolean getValue()

max

public AtomicValue max(Collator collator,
                       AtomicValue other)
                throws XPathException
Specified by:
max in class AtomicValue
Throws:
XPathException

min

public AtomicValue min(Collator collator,
                       AtomicValue other)
                throws XPathException
Specified by:
min in class AtomicValue
Throws:
XPathException

conversionPreference

public int conversionPreference(Class javaClass)
Description copied from interface: Sequence
Returns a preference indicator, indicating the preference of a value to be converted into the given Java class. Low numbers mean that the value can be easily converted into the given class.

Specified by:
conversionPreference in interface Item
Specified by:
conversionPreference in interface Sequence
Overrides:
conversionPreference in class AtomicValue

toJavaObject

public Object toJavaObject(Class target)
                    throws XPathException
Description copied from interface: Sequence
Convert the value into an instance of the specified Java class.

Specified by:
toJavaObject in interface Item
Specified by:
toJavaObject in interface Sequence
Overrides:
toJavaObject in class AtomicValue
Throws:
XPathException

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class AtomicValue


Copyright (C) Wolfgang Meier. All rights reserved.