net.sf.saxon.value
public final class BooleanValue extends AtomicValue implements Comparable
Field Summary | |
---|---|
static BooleanValue | FALSE
The boolean value FALSE |
static BooleanValue | TRUE
The boolean value TRUE |
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 |
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 |
Parameters: value the boolean value typeLabel the type label, xs:boolean or a subtype
Parameters: other The other boolean value
Returns: -1 if this one is the lower, 0 if they are equal, +1 if this one is the higher. False is considered to be less than true.
Throws: ClassCastException if the other value is not a BooleanValue (the parameter is declared as Object to satisfy the Comparable interface)
Parameters: requiredType an integer identifying the required atomic type context XPath dynamic context
Returns: an AtomicValue, a value of the required type
Parameters: typeLabel the atomic type label to be added to the copied value
Returns: the boolean value
Parameters: other the value to be compared to this value
Returns: true if the other value is a boolean value and is equal to this value
Throws: ClassCastException if other value is not xs:boolean or derived therefrom
Parameters: s the input string
Returns: the relevant BooleanValue if validation succeeds; or a ValidationFailure if not.
Parameters: value true or false, to determine which boolean value is required
Returns: the BooleanValue requested
Returns: true or false, the actual boolean value of this BooleanValue
Returns: "true" or "false"
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 BooleanValue when there is no defined order relationship between two given values.
Returns: a Comparable that follows XML Schema comparison rules
Parameters: ordered collator context
Returns: the hash code
Returns: a string representation of this value: "true()" or "false()"