public abstract class ExtendOperationExecutor<T> extends java.lang.Object implements ISearchOperation.ISearchOperationExecutor
Constructor and Description |
---|
ExtendOperationExecutor() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
cleanup(MatchingFrame frame,
ISearchContext context)
Restores the frame to the state before
fillInValue(Object, MatchingFrame, ISearchContext) . |
boolean |
execute(MatchingFrame frame,
ISearchContext context) |
protected abstract boolean |
fillInValue(T newValue,
MatchingFrame frame,
ISearchContext context)
Updates the frame with the next element of the iterator.
|
protected abstract java.util.Iterator<? extends T> |
getIterator(MatchingFrame frame,
ISearchContext context)
Returns an iterator with the possible options from the current state
|
void |
onBacktrack(MatchingFrame frame,
ISearchContext context)
After the execution of the operation failed and
ISearchOperation.ISearchOperationExecutor.execute(MatchingFrame, ISearchContext) returns false, the onBacktrack
callback is evaluated. |
void |
onInitialize(MatchingFrame frame,
ISearchContext context)
During the execution of the corresponding plan, the onInitialize callback is evaluated before the execution of
the operation may begin.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOperation
protected abstract java.util.Iterator<? extends T> getIterator(MatchingFrame frame, ISearchContext context)
protected abstract boolean fillInValue(T newValue, MatchingFrame frame, ISearchContext context)
execute(MatchingFrame, ISearchContext)
.protected abstract void cleanup(MatchingFrame frame, ISearchContext context)
fillInValue(Object, MatchingFrame, ISearchContext)
. Called during
onBacktrack(MatchingFrame, ISearchContext)
.public void onInitialize(MatchingFrame frame, ISearchContext context)
ISearchOperation.ISearchOperationExecutor
onInitialize
in interface ISearchOperation.ISearchOperationExecutor
public void onBacktrack(MatchingFrame frame, ISearchContext context)
ISearchOperation.ISearchOperationExecutor
ISearchOperation.ISearchOperationExecutor.execute(MatchingFrame, ISearchContext)
returns false, the onBacktrack
callback is evaluated. Operations may use this method to clean up any temporary structures, and make the
operation ready for a new execution.onBacktrack
in interface ISearchOperation.ISearchOperationExecutor
public boolean execute(MatchingFrame frame, ISearchContext context)
execute
in interface ISearchOperation.ISearchOperationExecutor