public abstract static class Value.Structured extends Value
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 |
---|
Structured() |
Modifier and Type | Method and Description |
---|---|
double |
AoM()
The
AoM of 'this'
complete Structured Value. |
protected java.lang.String |
closes()
Is ")", but can override to change
formatting . |
abstract Value |
elt(int i)
The i-th element (component, field) of 'this'
Structured Value, counting from zero.
|
Value[] |
elts()
All the elements (components, fields) as an array; this default
implementation may well be bettered in a sub-class.
|
Value |
frth()
frth(), short for
elt(3) . |
Value |
fst()
fst(), short for
elt(0) . |
abstract int |
nElts()
The number of elements (components, fields) in
'this' Structured Value.
|
double |
nlAoM()
The total
nlAoM of 'this'
complete Structured Value. |
protected java.lang.String |
opens()
Is "(", but can override to change
formatting . |
void |
print(java.io.PrintStream ps)
This default print(ps) outputs all elements,
(elt(0), elt(1), ...), to 'ps'.
|
protected java.lang.String |
separator()
Is ", " but can override to change
formatting . |
Value |
snd()
snd(), short for
elt(1) . |
Value |
thrd()
thrd(), short for
elt(2) . |
java.lang.String |
toString()
toString() may be acceptable for small Structured Values
or you may want
print(ps) instead?
Also see opens() , separator() ,
closes() , and Value.toString() . |
public abstract int nElts()
public abstract Value elt(int i)
public Value[] elts()
public double nlAoM()
nlAoM
of 'this'
complete Structured Value. This default sums the
nlAoM of all elements.
There may be better ways in some sub-classes.public void print(java.io.PrintStream ps)
opens()
, separator()
,
closes()
, and toString()
.public java.lang.String toString()
print(ps)
instead?
Also see opens()
, separator()
,
closes()
, and Value.toString()
.protected java.lang.String opens()
formatting
.protected java.lang.String separator()
formatting
.protected java.lang.String closes()
formatting
.