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
|
static One<StringValue> |
string(java.lang.String value)
Convenience function to create a singleton string value
|
effectiveBooleanValue, empty, getLength, getStringValue, getStringValueCS, head, itemAt, iterate, reduce, subsequence, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asIterable, iterator, materialize, toShortString
makeRepeatable
public 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 static One<BooleanValue> bool(boolean value)
value
- the boolean valuepublic static One<StringValue> string(java.lang.String value)
value
- the string valuepublic 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. All rights reserved.