public class One<T extends Item> extends ZeroOrOne<T>
To extract the wrapped item, use ZeroOrOne.head().
| Constructor and Description |
|---|
One(T item)
Create an instance of the class
|
| Modifier and Type | Method and Description |
|---|---|
static One<BooleanValue> |
bool(boolean value)
Convenience function to create a singleton boolean value
|
static One<DoubleValue> |
dbl(double value)
Convenience function to create a singleton double value
|
static One<IntegerValue> |
integer(long value)
Convenience function to create a singleton integer value
|
ConstrainedIterator<T> |
iterate()
Return an iterator over this value.
|
static One<StringValue> |
string(java.lang.String value)
Convenience function to create a singleton string value
|
effectiveBooleanValue, empty, getLength, getStringValue, getStringValueCS, head, itemAt, reduce, subsequence, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasIterable, concatenate, containsNode, materialize, toShortStringmakeRepeatablepublic One(T item)
item - The single item to be contained in the sequence. Must not be null.java.lang.NullPointerException - if item is null.public ConstrainedIterator<T> iterate()
iterate in interface GroundedValueiterate in interface Sequenceiterate in class ZeroOrOne<T extends Item>SequenceIterator rather than a Java
Iterator) over all the items in this Sequence.public static One<BooleanValue> bool(boolean value)
value - the boolean valuepublic static One<StringValue> string(java.lang.String value)
value - the string value.. If null, the result will represent a zero-length stringpublic static One<IntegerValue> integer(long value)
value - the integer valuepublic static One<DoubleValue> dbl(double value)
value - the double valueCopyright (c) 2004-2020 Saxonica Limited.