public final class BooleanValue extends AtomicValue implements java.lang.Comparable, AtomicMatchKey
Modifier and Type | Field and Description |
---|---|
static BooleanValue |
FALSE
The boolean value FALSE
|
static BooleanValue |
TRUE
The boolean value TRUE
|
NaN_MATCH_KEY, typeLabel
Constructor and Description |
---|
BooleanValue(boolean value,
AtomicType typeLabel)
Create a new Boolean value with a user-supplied type label.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object other)
Compare the value to another boolean value
|
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
|
java.lang.String |
getPrimitiveStringValue()
Convert to string
|
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.
|
AtomicMatchKey |
getXPathComparable(boolean ordered,
StringCollator collator,
int implicitTimezone)
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, asMapKey, atomize, checkPermittedContents, checkValidInJavascript, getCanonicalLexicalRepresentation, getCardinality, getComponent, getItemType, getStringValue, getStringValueCS, getUType, head, identityHashCode, isIdentical, isIdentical, isNaN, itemAt, iterate, iterator, process, setTypeLabel
getLength, isStreamed, reduce, subsequence
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asAtomic
getLength
reduce, subsequence
public 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 AtomicValue
typeLabel
- 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 interface GroundedValue
effectiveBooleanValue
in class AtomicValue
public BuiltInAtomicType getPrimitiveType()
getPrimitiveType
in class AtomicValue
public java.lang.String getPrimitiveStringValue()
getPrimitiveStringValue
in class AtomicValue
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 SequenceTool.INDETERMINATE_ORDERING
when there
is no defined order relationship between two given values.
getSchemaComparable
in interface AtomicSequence
getSchemaComparable
in class AtomicValue
public AtomicMatchKey getXPathComparable(boolean ordered, StringCollator collator, int implicitTimezone)
getXPathComparable
in class AtomicValue
ordered
- true if an ordered comparison is required. In this case the result is null if the
type is unordered; in other cases the returned value will be a Comparable.collator
- the collation to be used when comparing stringsimplicitTimezone
- the XPath dynamic evaluation context, used in cases where the comparison is context
sensitivepublic int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- 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 AtomicValue
other
- 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.Object
public java.lang.String toString()
toString
in class AtomicValue
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.