public final class BooleanValue extends AtomicValue implements Comparable
Modifier and Type | Field and Description |
---|---|
static BooleanValue |
FALSE
The boolean value FALSE
|
static BooleanValue |
TRUE
The boolean value TRUE
|
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.
|
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
|
asAtomic, checkPermittedContents, getCanonicalLexicalRepresentation, getCardinality, getComponent, getItemType, getStringValue, getStringValueCS, head, isIdentical, isIdentical, isNaN, itemAt, iterate, process, setTypeLabel
getLength, reduce, subsequence
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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 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 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-2013 Saxonica Limited. All rights reserved.