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 Goal
public abstract Pass createPass(ExtensionInfo extInfo)
createPass
in interface Goal
public java.lang.String name()
Goal
public Job job()
Goal
public java.util.Collection<Goal> prerequisiteGoals(Scheduler scheduler)
Goal
prerequisiteGoals
in interface Goal
public java.util.Collection<Goal> corequisiteGoals(Scheduler scheduler)
Goal
corequisiteGoals
in interface Goal
public void addPrerequisiteGoal(Goal g, Scheduler scheduler) throws CyclicDependencyException
Goal
g
. g
must be completed
before this goal is attempted. g
should be interned.addPrerequisiteGoal
in interface Goal
CyclicDependencyException
- if a prerequisite of g
is this
protected void checkCycles(Goal current, Scheduler scheduler) throws CyclicDependencyException
CyclicDependencyException
public void addCorequisiteGoal(Goal g, Scheduler scheduler)
Goal
g
. 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 Goal
public void setUnreachableThisRun()
setUnreachableThisRun
in interface Goal
public boolean hasBeenReached()
Goal
hasBeenReached
in interface Goal
public void setUnreachable()
Goal
setUnreachable
in interface Goal
public boolean isReachable()
Goal
isReachable
in interface Goal
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected java.lang.String stateString()
public java.lang.String toString()
toString
in class java.lang.Object