public abstract static class Value.Option extends Value.Structured
n()
, and zero or more
sub-Values, Value.Structured.elt(int)
depending on the tag.
For example, see linked Lists
.
Also see Type.Option
.Modifier and Type | Class and Description |
---|---|
static class |
Value.Option.GP
A general purpose (GP) implementation of an
Value.Option Value;
also see Type.Option , and Value.List . |
Value.Atomic, Value.Bool, Value.Char, Value.Chars, Value.Cts, Value.Defer, Value.Discrete, Value.Enum, Value.Inc_Or, Value.Int, Value.Lambda, Value.List, Value.Maybe, Value.Option, Value.Real, Value.Scannable, Value.Structured, Value.Triv, Value.Tuple
Constructor and Description |
---|
Option() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
closes()
Is ")" if nElts()>0; see
Value.Structured.print(java.io.PrintStream) . |
int |
compareTo(Value rgt)
Is 'this' Option < (-1), > (+1), or = (0) rgt?
Note, 'this' and 'rgt' must be of the same Option Type.
|
abstract int |
n()
Return this Option Value's number within its
Option
Type . |
int |
nElts()
Return this Option's number of elements (fields).
|
protected java.lang.String |
opens()
Is ["("]+id where id is the
name
of 'this' Option Value; see Value.Structured.print(java.io.PrintStream) . |
protected java.lang.String |
separator()
Is space, " "; see
Value.Structured.print(java.io.PrintStream) . |
AoM, elt, elts, frth, fst, nlAoM, print, snd, thrd, toString
public abstract int n()
Type
.public int nElts()
nElts
in class Value.Structured
public int compareTo(Value rgt)
n()
then,
if n()s are equal, on the elements in order.protected java.lang.String opens()
name
of 'this' Option Value; see Value.Structured.print(java.io.PrintStream)
.
For example, EmptyTree | (Fork ...).opens
in class Value.Structured
protected java.lang.String separator()
Value.Structured.print(java.io.PrintStream)
.separator
in class Value.Structured
protected java.lang.String closes()
Value.Structured.print(java.io.PrintStream)
.closes
in class Value.Structured