public class PhaseSuite<C> extends BasePhase<C> implements PhasePlan<BasePhase<? super C>>
BasePhase.ApplyScope, BasePhase.BasePhaseStatistics, BasePhase.PhaseOptions, BasePhase.SharedGlobalPhaseStatePhasePlan.Printer| Constructor and Description |
|---|
PhaseSuite() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBeforeLast(BasePhase<? super C> phase)
Inserts a phase before the last phase in the suite.
|
void |
appendPhase(BasePhase<? super C> phase)
Add a new phase at the end of this suite.
|
boolean |
checkContract() |
PhaseSuite<C> |
copy() |
ListIterator<BasePhase<? super C>> |
findLastPhase()
Returns a
ListIterator at the position of the last phase in the suite. |
static <C> boolean |
findNextPhase(ListIterator<BasePhase<? super C>> it,
Class<? extends BasePhase<? super C>> phaseClass) |
static <C> boolean |
findNextPhase(ListIterator<BasePhase<? super C>> it,
Class<? extends BasePhase<? super C>> phaseClass,
boolean recursive) |
ListIterator<BasePhase<? super C>> |
findPhase(Class<? extends BasePhase<? super C>> phaseClass)
Returns a
ListIterator at the position of the first phase which is an instance of
phaseClass or null if no such phase can be found. |
ListIterator<BasePhase<? super C>> |
findPhase(Class<? extends BasePhase<? super C>> phaseClass,
boolean recursive)
Returns a
ListIterator at the position of the first phase which is an instance of
phaseClass or, if recursive is true, is a PhaseSuite containing a
phase which is an instance of phaseClass. |
String |
getPhaseName(BasePhase<? super C> phase)
Gets a name for a phase in the plan.
|
List<BasePhase<? super C>> |
getPhases()
Gets an unmodifiable view on the phases in this suite.
|
boolean |
isImmutable() |
void |
prependPhase(BasePhase<? super C> phase)
Add a new phase at the beginning of this suite.
|
boolean |
removePhase(Class<? extends BasePhase<? super C>> phaseClass)
Removes the first instance of the given phase class, looking recursively into inner phase
suites.
|
boolean |
replaceAllPhases(Class<? extends BasePhase<? super C>> phaseClass,
Supplier<BasePhase<? super C>> newPhase)
Replaces all instances of the given phase class, looking recursively into inner phase suites.
|
boolean |
replacePhase(Class<? extends BasePhase<? super C>> phaseClass,
BasePhase<? super C> newPhase)
Replaces the first instance of the given phase class, looking recursively into inner phase
suites.
|
protected void |
run(StructuredGraph graph,
C context) |
void |
setImmutable() |
String |
toString() |
apply, apply, applyScope, codeSizeIncrease, contractorName, equals, getName, hashCode, shouldDumpAfterAtBasicLevel, shouldDumpBeforeAtBasicLevelpublic boolean checkContract()
checkContract in interface PhaseSizeContractpublic boolean isImmutable()
public void setImmutable()
public final void prependPhase(BasePhase<? super C> phase)
public final void appendPhase(BasePhase<? super C> phase)
public final void addBeforeLast(BasePhase<? super C> phase)
public ListIterator<BasePhase<? super C>> findLastPhase()
ListIterator at the position of the last phase in the suite. If the suite
has no phases then it will return an empty iterator.public List<BasePhase<? super C>> getPhases()
public String getPhaseName(BasePhase<? super C> phase)
PhasePlangetPhaseName in interface PhasePlan<BasePhase<? super C>>public final ListIterator<BasePhase<? super C>> findPhase(Class<? extends BasePhase<? super C>> phaseClass)
ListIterator at the position of the first phase which is an instance of
phaseClass or null if no such phase can be found.
Calling ListIterator.previous() would return the phase that was found.phaseClass - the type of phase to look for.public final ListIterator<BasePhase<? super C>> findPhase(Class<? extends BasePhase<? super C>> phaseClass, boolean recursive)
ListIterator at the position of the first phase which is an instance of
phaseClass or, if recursive is true, is a PhaseSuite containing a
phase which is an instance of phaseClass. This method returns null if no such phase
can be found.
Calling ListIterator.previous() would return the phase or phase suite that was found.phaseClass - the type of phase to look forrecursive - whether to recursively look into phase suites.public static <C> boolean findNextPhase(ListIterator<BasePhase<? super C>> it, Class<? extends BasePhase<? super C>> phaseClass)
public static <C> boolean findNextPhase(ListIterator<BasePhase<? super C>> it, Class<? extends BasePhase<? super C>> phaseClass, boolean recursive)
public boolean removePhase(Class<? extends BasePhase<? super C>> phaseClass)
public boolean replacePhase(Class<? extends BasePhase<? super C>> phaseClass, BasePhase<? super C> newPhase)
public boolean replaceAllPhases(Class<? extends BasePhase<? super C>> phaseClass, Supplier<BasePhase<? super C>> newPhase)
true if at least one replacement was made, false otherwise.protected void run(StructuredGraph graph, C context)
public PhaseSuite<C> copy()