|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IBindingSet
Interface for a set of bindings. The set of variables values is extensible and the bound values are loosely typed.
This change would require that the singleton factory for a variable was
on the Rule (different rules would have different index
assignments), it would require predicates to be cloned into a
Rule so that the variables possessed the necessary index
assignment, and that index assignment would have to be late - once the
evaluation order was determined, so maybe the Rule is cloned into the
RuleState once we have the evaluation order.
There would also need to be a type-specific means for copying bindings from a visited element into a bindingSet if a want to avoid autoboxing.
The IConstant interface might have to disappear for this as
well. I am not convinced that it adds much.
To obtain a Var you MUST go to the IVariable factory on
the IRule. (It is easy to find violators since all vars are
currently assigned by a single factory.)
Since we sometimes do not have access to the rule that generated the bindings, we would also require the ability to retrieve a binding by the name of the variable (this case arises when the rule is generated dynamically in a manner that is not visible to the consumer of the bindings, e.g., the match rule of the RDF DB).
| Method Summary | |
|---|---|
void |
clear(IVariable var)
Clear any binding for the variable. |
void |
clearAll()
Clear all bindings. |
IBindingSet |
clone()
Return a shallow copy of the binding set. |
boolean |
equals(IBindingSet o)
True iff the variables and their bound values are the same for the two binding sets. |
IConstant |
get(IVariable var)
Return the binding for the variable. |
boolean |
isBound(IVariable var)
Return true iff the variable is bound. |
Iterator<Map.Entry<IVariable,IConstant>> |
iterator()
Visits the bindings. |
void |
set(IVariable var,
IConstant val)
Bind the variable to the value. |
int |
size()
The #of bound variables. |
Iterator<IVariable> |
vars()
Visits the bound variables. |
| Method Detail |
|---|
boolean isBound(IVariable var)
true iff the variable is bound.
var - The variable.
true if the variable is bound.
IllegalArgumentException - if var is null.
void set(IVariable var,
IConstant val)
var - The variable.val - The value (MAY NOT be null).
IllegalArgumentException - if var is null.
IllegalArgumentException - if val is null.IConstant get(IVariable var)
var - The variable.
null iff the
variable is not bound.
IllegalArgumentException - if var is null.void clear(IVariable var)
var - The variable.
IllegalArgumentException - if var is null.void clearAll()
int size()
Iterator<Map.Entry<IVariable,IConstant>> iterator()
Iterator<IVariable> vars()
IBindingSet clone()
boolean equals(IBindingSet o)
o - Another binding set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||