java.io.Serializable, java.lang.Comparable, PullEvent, SequenceIterable, GroundedValue, Item, ValueRepresentation, ConversionResultpublic final class BooleanValue extends AtomicValue implements java.lang.Comparable
| Modifier and Type | Field | Description |
|---|---|---|
static BooleanValue |
FALSE |
The boolean value FALSE
|
static BooleanValue |
TRUE |
The boolean value TRUE
|
typeLabelEMPTY_CLASS_ARRAY, INDETERMINATE_ORDERINGEMPTY_VALUE_ARRAY| Constructor | Description |
|---|---|
BooleanValue(boolean value,
AtomicType typeLabel) |
Create a new Boolean value with a user-supplied type label.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
compareTo(java.lang.Object other) |
Compare the value to another boolean value
|
ConversionResult |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context) |
Convert to target data type
|
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(java.lang.Object other) |
Determine whether two boolean values are equal
|
static ConversionResult |
fromString(java.lang.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.
|
java.lang.Comparable |
getSchemaComparable() |
Get a Comparable value that implements the XML Schema ordering comparison semantics for this value.
|
java.lang.String |
getStringValue() |
Convert to string
|
java.lang.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
|
java.lang.String |
toString() |
Diagnostic display of this value as a string
|
asAtomic, checkPermittedContents, convert, convert, getCardinality, getComponent, getItemType, getLength, getStringValueCS, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequenceclone, finalize, getClass, notify, notifyAll, wait, wait, waitasItem, asItem, asIterator, asValue, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, makeQNameValue, reduce, stringToNumberpublic static final BooleanValue TRUE
public static final BooleanValue FALSE
public BooleanValue(boolean value,
AtomicType typeLabel)
value - the boolean valuetypeLabel - the type label, xs:boolean or a subtypepublic static BooleanValue get(boolean value)
value - true or false, to determine which boolean value is
requiredpublic AtomicValue copyAsSubType(AtomicType typeLabel)
copyAsSubType in class AtomicValuetypeLabel - the atomic type label to be added to the copied valuepublic static ConversionResult fromString(java.lang.CharSequence s)
s - the input stringpublic boolean getBooleanValue()
public boolean effectiveBooleanValue()
effectiveBooleanValue in class AtomicValuepublic BuiltInAtomicType getPrimitiveType()
getPrimitiveType in class AtomicValuepublic ConversionResult convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
convertPrimitive in class AtomicValuerequiredType - 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 java.lang.String getStringValue()
getStringValue in interface ItemgetStringValue in interface ValueRepresentationgetStringValue in class AtomicValueItem.getStringValueCS()public java.lang.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 AtomicValuepublic java.lang.Object getXPathComparable(boolean ordered,
StringCollator collator,
XPathContext context)
getXPathComparable in class AtomicValueordered - collator - context - public int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparableother - The other boolean valuejava.lang.ClassCastException - if the other value is not a BooleanValue
(the parameter is declared as Object to satisfy the Comparable
interface)public boolean equals(java.lang.Object other)
equals in class AtomicValueother - the value to be compared to this valuejava.lang.ClassCastException - if other value is not xs:boolean or derived therefrompublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class AtomicValue