|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.value.Value net.sf.saxon.value.AtomicValue net.sf.saxon.value.BooleanValue
public final class BooleanValue
A boolean XPath value
Field Summary | |
---|---|
static BooleanValue |
FALSE
The boolean value FALSE |
static BooleanValue |
TRUE
The boolean value TRUE |
Fields inherited from class net.sf.saxon.value.Value |
---|
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
---|
EMPTY_VALUE_ARRAY |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
---|
EMPTY_VALUE_ARRAY |
Constructor Summary | |
---|---|
BooleanValue(boolean value,
AtomicType typeLabel)
Create a new Boolean value with a user-supplied type label. |
Method Summary | |
---|---|
int |
compareTo(Object other)
Compare the value to another boolean value |
ConversionResult |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context)
Convert to target data type |
Object |
convertToJava(Class target,
XPathContext context)
Convert to Java object (for passing to external functions) |
AtomicValue |
copyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value (usually so that the type label can be changed). |
boolean |
effectiveBooleanValue()
Get the effective boolean value of this expression |
boolean |
equals(Object other)
Determine whether two boolean values are equal |
static ConversionResult |
fromString(CharSequence s)
Convert a string to a boolean value, using the XML Schema rules (including whitespace trimming) |
static BooleanValue |
get(boolean value)
Factory method: get a BooleanValue |
boolean |
getBooleanValue()
Get the value |
BuiltInAtomicType |
getPrimitiveType()
Determine the primitive type of the value. |
Comparable |
getSchemaComparable()
Get a Comparable value that implements the XML Schema ordering comparison semantics for this value. |
String |
getStringValue()
Convert to string |
Object |
getXPathComparable(boolean ordered,
StringCollator collator,
XPathContext context)
Get a Comparable value that implements the XPath ordering comparison semantics for this value. |
int |
hashCode()
Get a hash code for comparing two BooleanValues |
String |
toString()
Diagnostic display of this value as a string |
Methods inherited from class net.sf.saxon.value.AtomicValue |
---|
asAtomic, checkPermittedContents, convert, convert, getCardinality, getComponent, getItemType, getLength, getStringValueCS, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence |
Methods inherited from class net.sf.saxon.value.Value |
---|
asItem, asItem, asIterator, asValue, convertJavaObjectToXPath, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, makeQNameValue, reduce, stringToNumber |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final BooleanValue TRUE
public static final BooleanValue FALSE
Constructor Detail |
---|
public BooleanValue(boolean value, AtomicType typeLabel)
value
- the boolean valuetypeLabel
- the type label, xs:boolean or a subtypeMethod Detail |
---|
public static BooleanValue get(boolean value)
value
- true or false, to determine which boolean value is
required
public AtomicValue copyAsSubType(AtomicType typeLabel)
copyAsSubType
in class AtomicValue
typeLabel
- the atomic type label to be added to the copied value
public static ConversionResult fromString(CharSequence s)
s
- the input string
public boolean getBooleanValue()
public boolean effectiveBooleanValue()
effectiveBooleanValue
in class AtomicValue
public BuiltInAtomicType getPrimitiveType()
getPrimitiveType
in class AtomicValue
public ConversionResult convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
requiredType
- an integer identifying the required atomic typecontext
- XPath dynamic contextvalidate
- true if validation is required. If set to false, the caller guarantees that
the value is valid for the target data type, and that further validation
is therefore not required.
Note that a validation failure may be reported even if validation was not requested.
public String getStringValue()
getStringValue
in interface Item
getStringValue
in interface ValueRepresentation
getStringValue
in class AtomicValue
Item.getStringValueCS()
public Object convertToJava(Class target, XPathContext context) throws XPathException
convertToJava
in class Value
target
- the Java class to which conversion is requiredcontext
- the XPath dynamic evaluation context
XPathException
- if conversion is not possible or failspublic Comparable getSchemaComparable()
In the case of data types that are partially ordered, the returned Comparable extends the standard
semantics of the compareTo() method by returning the value Value.INDETERMINATE_ORDERING
when there
is no defined order relationship between two given values.
getSchemaComparable
in class AtomicValue
public Object getXPathComparable(boolean ordered, StringCollator collator, XPathContext context)
getXPathComparable
in class AtomicValue
ordered
- collator
- context
-
public int compareTo(Object other)
compareTo
in interface Comparable
other
- The other boolean value
ClassCastException
- if the other value is not a BooleanValue
(the parameter is declared as Object to satisfy the Comparable
interface)public boolean equals(Object other)
equals
in class AtomicValue
other
- the value to be compared to this value
ClassCastException
- if other value is not xs:boolean or derived therefrompublic int hashCode()
hashCode
in class Object
public String toString()
toString
in class AtomicValue
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |