public abstract class AbstractGoal extends java.lang.Object implements Goal
AbstractGoal is the base class of most Goal
implementations.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<Goal> |
corequisites |
protected Job |
job |
protected java.lang.String |
name |
protected java.util.Set<Goal> |
prerequisites |
protected int |
state |
ATTEMPTED, REACHED, RUNNING, UNREACHABLE, UNREACHABLE_THIS_RUN, UNREACHED| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGoal(Job job) |
protected |
AbstractGoal(Job job,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCorequisiteGoal(Goal g,
Scheduler scheduler)
Add a new corequisite subgoal
g. |
void |
addPrerequisiteGoal(Goal g,
Scheduler scheduler)
Add a new subgoal
g. |
protected void |
checkCycles(Goal current,
Scheduler scheduler) |
boolean |
conflictsWith(Goal goal)
Return true if this goal conflicts with the other; that is passes running
over both goals could access the same data.
|
java.util.Collection<Goal> |
corequisiteGoals(Scheduler scheduler)
Goals on which this goal may mutually depend.
|
abstract Pass |
createPass(ExtensionInfo extInfo)
Creates a pass to attempt to satisfy the goal.
|
boolean |
equals(java.lang.Object o) |
boolean |
hasBeenReached()
Return true if this goal has been reached.
|
int |
hashCode() |
boolean |
isReachable()
Return true if this goal is reachable.
|
Job |
job()
Get the job associated with this goal, or null.
|
java.lang.String |
name()
Get the name of the goal for debugging.
|
java.util.Collection<Goal> |
prerequisiteGoals(Scheduler scheduler)
Goals that must be completed before attempting this goal.
|
void |
setState(int state) |
void |
setUnreachable()
Set a flag indicating that this rule is unreachable.
|
void |
setUnreachableThisRun()
Mark the goal as reached or not reached.
|
int |
state() |
protected java.lang.String |
stateString() |
java.lang.String |
toString() |
protected Job job
protected java.lang.String name
protected int state
protected java.util.Set<Goal> corequisites
protected java.util.Set<Goal> prerequisites
protected AbstractGoal(Job job)
protected AbstractGoal(Job job, java.lang.String name)
public boolean conflictsWith(Goal goal)
conflictsWith in interface Goalpublic abstract Pass createPass(ExtensionInfo extInfo)
createPass in interface Goalpublic java.lang.String name()
Goalpublic Job job()
Goalpublic java.util.Collection<Goal> prerequisiteGoals(Scheduler scheduler)
GoalprerequisiteGoals in interface Goalpublic java.util.Collection<Goal> corequisiteGoals(Scheduler scheduler)
GoalcorequisiteGoals in interface Goalpublic void addPrerequisiteGoal(Goal g, Scheduler scheduler) throws CyclicDependencyException
Goalg. g must be completed
before this goal is attempted. g should be interned.addPrerequisiteGoal in interface GoalCyclicDependencyException - if a prerequisite of g is thisprotected void checkCycles(Goal current, Scheduler scheduler) throws CyclicDependencyException
CyclicDependencyExceptionpublic void addCorequisiteGoal(Goal g, Scheduler scheduler)
Goalg. g is a
goal on which this goal mutually depends. The caller must be careful
to ensure that all corequisite goals can be eventually reached.
g should be interned.addCorequisiteGoal in interface Goalpublic void setUnreachableThisRun()
setUnreachableThisRun in interface Goalpublic boolean hasBeenReached()
GoalhasBeenReached in interface Goalpublic void setUnreachable()
GoalsetUnreachable in interface Goalpublic boolean isReachable()
GoalisReachable in interface Goalpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected java.lang.String stateString()
public java.lang.String toString()
toString in class java.lang.Object