Package org.tensorics.core.tree.domain
Interface ResolvingContext
-
- All Known Subinterfaces:
EditableResolvingContext
- All Known Implementing Classes:
ResolvingContextImpl
public interface ResolvingContext
A container for resolved expressions which can be used by resolvers of expressions that need these results.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <R,E extends Expression<R>>
RresolvedValueOf(E expression)
Retrieves the resolved value for the expression.<E extends Expression<?>>
booleanresolves(E expression)
Checks if the expression is resolved within this context.int
size()
Retrieves the amount of resolved values which are stored in the context.
-
-
-
Method Detail
-
resolves
<E extends Expression<?>> boolean resolves(E expression)
Checks if the expression is resolved within this context. Only if this method returnstrue
, then it is safe to call theresolvedValueOf(Expression)
method. An expression is seen as resolved, either if the context knows already the resolved value or, if the given expression is a resolved expression by itself.- Parameters:
expression
- the expression for which to check if it is resolved- Returns:
true
if the expression is resolved within the context,false
if not
-
resolvedValueOf
<R,E extends Expression<R>> R resolvedValueOf(E expression)
Retrieves the resolved value for the expression. This action can be completed, if the result of the given expression is already known within the context, or if the expression is a resolved expression itself.An
IllegalArgumentException
will be thrown, if the expression cannot be resolved within the context. Therefore it is mandatory to call theresolves(Expression)
method first to check if the expression is resolved in the context.- Parameters:
expression
- the expression for which to retrieve the resolved value- Returns:
- the resolved value for the expression
-
size
int size()
Retrieves the amount of resolved values which are stored in the context.- Returns:
- the number of stored resolved values
-
-