public final class BooleanValue extends AtomicValue implements 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(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(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
|
String |
getPrimitiveStringValue()
Convert to string
|
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.
|
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
|
String |
toString()
Diagnostic display of this value as a string
|
asAtomic, checkPermittedContents, getCanonicalLexicalRepresentation, getCardinality, getComponent, getItemType, getStringValue, getStringValueCS, head, identityHashCode, isIdentical, isIdentical, isNaN, itemAt, iterate, iterator, process, setTypeLabel
getLength, 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(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 String getPrimitiveStringValue()
getPrimitiveStringValue
in class AtomicValue
public 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(Object other)
compareTo
in interface Comparable
other
- The other boolean valueClassCastException
- 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 valueClassCastException
- if other value is not xs:boolean or derived therefrompublic int hashCode()
public String toString()
toString
in class AtomicValue
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.