| com.hp.hpl.jena.graph.query.Expression
Expression | public interface Expression (Code) | | Expression - the interface for expressions that is expected by Query for
constraints. An Expression can be evaluated (given a name->value mapping);
it can be prepared into a Valuator (given a name->index mapping); and it can
be analysed into its components.
An Expression can be a variable, an application, or a literal value. If an access
method (eg getName) is applied to an Expression for which it is not appropriate
(eg an application), the result is unspecified; an implementation is
free to throw an exception, deliver a null result, deliver a misleading value,
whatever is convenient.
The nested class Util provides some expression utility
methods, including a generic version of prepare . The nested
abstract class Base and its sub-classes Literal ,
Variable , and Application provide a framework
for developers to implement Expressions over.
author: kers |
Inner Class :abstract public static class Base implements Expression | |
Inner Class :abstract public static class Constant extends Base | |
Inner Class :public static class Fixed extends Constant | |
Inner Class :abstract public static class Variable extends Base | |
Inner Class :abstract public static class Application extends Base | |
Inner Class :public static class Util | |
Field Summary | |
public static Expression | FALSE An Expression which always evaluates to false . | public static Expression | TRUE An Expression which always evaluates to true . |
Method Summary | |
public int | argCount() If this Expression is an application, answer the number of arguments that
it has. | public Expression | getArg(int i) If this Expression is an application, and 0 <= i < argCount(), answer the
i th argument. | public String | getFun() If this Expression is an application, return the string identifying the function,
which should be a URI. | public String | getName() If this Expression is a variable, answer a [non-null] String which is its name. | public Object | getValue() If this Expression is a literal, answer the value of that literal. | public boolean | isApply() Answer true iff this Expression represents the application of some function
[or operator] to some arguments [or operands]. | public boolean | isConstant() Answer true iff this Expression represents a literal [Java object] value. | public boolean | isVariable() Answer true iff this Expression represents a variable. | public Valuator | prepare(VariableIndexes vi) |
FALSE | public static Expression FALSE(Code) | | An Expression which always evaluates to false .
|
TRUE | public static Expression TRUE(Code) | | An Expression which always evaluates to true .
|
argCount | public int argCount()(Code) | | If this Expression is an application, answer the number of arguments that
it has. Otherwise the behaviour is unspecified.
|
getArg | public Expression getArg(int i)(Code) | | If this Expression is an application, and 0 <= i < argCount(), answer the
i th argument. Otherwise the behaviour is unspecified.
|
getFun | public String getFun()(Code) | | If this Expression is an application, return the string identifying the function,
which should be a URI. Otherwise the behaviour is unspecified.
|
getName | public String getName()(Code) | | If this Expression is a variable, answer a [non-null] String which is its name.
Otherwise the behaviour is unspecified.
|
getValue | public Object getValue()(Code) | | If this Expression is a literal, answer the value of that literal. Otherwise the
behaviour is unspecified.
|
isApply | public boolean isApply()(Code) | | Answer true iff this Expression represents the application of some function
[or operator] to some arguments [or operands].
|
isConstant | public boolean isConstant()(Code) | | Answer true iff this Expression represents a literal [Java object] value.
|
isVariable | public boolean isVariable()(Code) | | Answer true iff this Expression represents a variable.
|
prepare | public Valuator prepare(VariableIndexes vi)(Code) | | Answer a Valuator which, when run with a set of index-to-value bindings,
evaluates this expression in the light of the given variable-to-index bindings
[ie as though the variables were bound to the corresponding values]
|
|
|