|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJSHOP2.Precondition
public abstract class Precondition
This abstract class represents an iterator over all the possible bindings that can satisfy its corresponding logical expression at run time.
Field Summary | |
---|---|
(package private) Term[][] |
bindings
The array that stores the sorted satisfiers for this logical precondition if this is a :sort-by logical precondition. |
(package private) int |
bindingsIdx
The index pointing to the next satisfier to be returned in case this is a :sort-by logical precondition. |
private java.util.Comparator<Term[]> |
comp
The function to be used to sort the possible bindings if this is a :sort-by logical precondition. |
private boolean |
first
Whether or not this logical expression is marked :first . |
private boolean |
firstCall
Whether or not this is the first time the nextBinding
function is called for this object after the latest call to its
reset function. |
Constructor Summary | |
---|---|
Precondition()
|
Method Summary | |
---|---|
abstract void |
bind(Term[] binding)
This abstract function binds the logical expression to a given binding. |
Term[] |
nextBinding()
This function returns the next satisfier for this logical expression. |
protected abstract Term[] |
nextBindingHelper()
This abstract function is called by the nextBinding function
and does the subclass-specific part of the finding the next binding. |
void |
reset()
This function resets this iterator so that it can iterate over again. |
protected abstract void |
resetHelper()
This abstract function is called by the reset function and
does the subclass-specific part of the resetting. |
Precondition |
setComparator(java.util.Comparator<Term[]> compIn)
To set the function to be used to sort the possible bindings that satisfy this logical precondition. |
void |
setFirst(boolean firstIn)
To set whether or not this function is marked :fist . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Term[][] bindings
:sort-by
logical precondition.
int bindingsIdx
:sort-by
logical precondition.
private java.util.Comparator<Term[]> comp
:sort-by
logical precondition.
private boolean first
:first
.
private boolean firstCall
nextBinding
function is called for this object after the latest call to its
reset
function.
Constructor Detail |
---|
public Precondition()
Method Detail |
---|
public abstract void bind(Term[] binding)
binding
- the given binding.public Term[] nextBinding()
null
when that variable is not mapped under this
satisfier, null
if there is no such satisfier.protected abstract Term[] nextBindingHelper()
nextBinding
function
and does the subclass-specific part of the finding the next binding.
public void reset()
protected abstract void resetHelper()
reset
function and
does the subclass-specific part of the resetting.
public Precondition setComparator(java.util.Comparator<Term[]> compIn)
compIn
- the function to be used to sort the possible bindings in case
this is a :sort-by
logical precondition,
null
otherwise.
public void setFirst(boolean firstIn)
:fist
.
firstIn
- true
if this logical expression is marked
:first
, false
otherwise.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |