public final class Const<T> extends Object implements Op<T>, Serializable
Const
operation is a
terminal operation.
final static Op<Double> PI = Const.of("π", Math.PI);
final static Op<Double> ONE = Const.of(1.0);
Modifier and Type | Method and Description |
---|---|
T |
apply(T[] value) |
int |
arity()
Return the arity of the operation function.
|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
name()
Return the name of the operation.
|
static <T> Const<T> |
of(String name,
T value)
Return a new constant with the given name and value.
|
static <T> Const<T> |
of(T value)
Return a new constant with the given value.
|
String |
toString() |
T |
value()
Return the constant value.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
get, isTerminal, of
public int arity()
Op
public static <T> Const<T> of(String name, T value)
of
in interface Op<T>
T
- the constant typename
- the constant namevalue
- the constant valueNullPointerException
- if the given constant name
is
null
© 2007-2019 Franz Wilhelmstötter (2019-02-19 21:44)