Package org.tensorics.core.tree.domain
Class ResolvedExpression<R>
- java.lang.Object
-
- org.tensorics.core.tree.domain.ResolvedExpression<R>
-
- Type Parameters:
R
- the type of the resulting value of the expression
- All Implemented Interfaces:
java.io.Serializable
,Expression<R>
,Node
public final class ResolvedExpression<R> extends java.lang.Object implements Expression<R>, java.io.Serializable
An expression that needs no further processing. It contains already its own result, which can be simply retrieved by theget()
method.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
R
get()
Retrieves the value of the expression.java.util.List<Node>
getChildren()
Has to return the children of the node.int
hashCode()
boolean
isResolved()
returnstrue
if the expression contains a concrete value.static <T> ResolvedExpression<T>
of(T value)
java.lang.String
toString()
-
-
-
Method Detail
-
of
public static <T> ResolvedExpression<T> of(T value)
-
isResolved
public boolean isResolved()
Description copied from interface:Expression
returnstrue
if the expression contains a concrete value. Thus the methodExpression.get()
can be used to retrieve the actual value. If this method returnsfalse
, then the get method will throw an exception.- Specified by:
isResolved
in interfaceExpression<R>
- Returns:
true
if the value can be retrieved,false
otherwise.
-
get
public R get()
Description copied from interface:Expression
Retrieves the value of the expression. If the expression is deferred, then an expression will be thrown.- Specified by:
get
in interfaceExpression<R>
- Returns:
- the value of the expression.
-
getChildren
public java.util.List<Node> getChildren()
Description copied from interface:Node
Has to return the children of the node. This must never returnnull
- Specified by:
getChildren
in interfaceNode
- Returns:
- a list containing all the children of the node
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-