|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.mjc.Main.Task
This abstract class represents a single task to be performed by the compiler. A task is a single pass of the compiler, performed on one or (for efficiency) several compilation units. Each concrete task has a priority which is used for ordering tasks in a priority queue. This technique allows the compilation of transitively referenced files to be "caught up" with the compilation of files named at the command line.
| Field Summary | |
private int |
priority
|
private Object |
sequenceID
|
private int |
uniqueNumber
This is a unique number assigned to each task and used in compareTo(Object) to differentiate between two
tasks with the same priority. |
| Constructor Summary | |
Main.Task(int priority,
Object sequenceID)
Creates a new task of the given priority and sequenceID. |
|
| Method Summary | |
int |
compareTo(Object other)
Compare tasks, ensuring that tasks of equal priority are not equal. |
abstract void |
execute()
Executes the task represented by this. |
int |
priority()
Returns the relative priority of this task. |
Object |
sequenceID()
Returns the unique sequenceID for tasks in this sequence. |
Main.Task |
setToMainSequenceID()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int priority
private Object sequenceID
private int uniqueNumber
compareTo(Object) to differentiate between two
tasks with the same priority.
| Constructor Detail |
public Main.Task(int priority,
Object sequenceID)
ensures !completed;
| Method Detail |
public final int priority()
public final Object sequenceID()
public final Main.Task setToMainSequenceID()
public final int compareTo(Object other)
also old Task otherTask = (Task) other; requires other instanceof Task; {| requires priority != otherTask.priority; ensures \result == priority - otherTask.priority; also requires priority == otherTask.priority; ensures \result == 0 <==> this == otherTask; |}
compareTo in interface Comparablepublic abstract void execute()
requires !completed; ensures completed;
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||