|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmauda.OperationRecorder
public class OperationRecorder
Records all executed operations, and provides methods to manipulate them.
| Constructor Summary | |
|---|---|
OperationRecorder()
Creates a OperationRecorder |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object obj)
Adds an operation to the recorder. |
void |
addEntry(java.lang.Object o)
Adds an entry to the end |
void |
addOperations(java.util.Vector v)
Adds all operations of the Vector to the recorder. |
boolean |
canUndo()
Check if an undo is possible |
void |
clear()
Clears all entries |
void |
decreaseTodoPosition()
Decreases the todo-position, what means that the border between init- and todo-operations moves up. |
void |
exerciseUpdate(ExerciseUpdateEvent e)
Invoked when an Event occures |
OperationQueue |
getAllInitOperationQueue()
Gets the init-operations as an OperationQueue. |
OperationQueue |
getAllTodoOperationQueue()
Gets the todo-operations as an OperationQueue. |
SubOperation |
getCorrectSubOperation(int opnr,
int subopnr)
Gets the correct subopnr'th suboperation of the opnr'th operation. |
int |
getCurrentOffset()
Gets the current offset (recorder-internal-value) |
java.lang.Object |
getCurrentOperation()
Gets the current operation |
int |
getCurrentOperationNr()
Gets the number of the current operation, counted from 0. |
int |
getCurrentSubOperationNr()
Gets the number of the current suboperation, counted from 0, inside the current Operation. |
java.lang.Object |
getEntry(int offset)
Gets the entry at the specified offset |
Failure |
getFirstFailure()
Gets the first failure in an exercise represented by a failure-object. |
OperationQueue |
getInitOperationQueue()
Gets the init-operations as an OperationQueue. |
java.util.Vector |
getInitOperations()
Gets the init-operations as an Vector. |
Failure |
getLimitedFailure(int offset)
Gets the first failure that lies beyond the specified offset. |
java.lang.Object |
getNextOperation()
Gets the operation that follows to the actual operation. |
int |
getOffset(int opnr,
int subopnr)
Gets the overall-offset (internal) of the subopnr'th suboperation inside the opnr'th operation. opnr must be a value started at 0, but subopnr can be value started at -1. |
Operation |
getOperation(int opnr)
Gets the opnr'th operation. |
int |
getOperationCount()
Returns the number of operations executed |
int |
getPossibleTodoPosition(int newTodoPosition)
Creates a possible todo-position from the given todo-position |
SubOperation |
getSubOperation(int opnr,
int subopnr)
Gets the present subopnr'th suboperation of the opnr'th operation. |
OperationQueue |
getTodoOperationQueue()
Gets the todo-operations as an OperationQueue. |
java.util.Vector |
getTodoOperations()
Gets the todo-operations as an Vector. |
int |
getTodoPosition()
Gets the current todo-position |
Failure |
getUnlimitedFailure(int offset)
Gets the first failure that lies beyond the specified offset. |
void |
goInTodoMode()
Switch the OperationRecorder in the todo-state, what means that all following operations are todo-operations for the exercise. |
void |
increaseTodoPosition()
Increases the todo-position, what means that the border between init- and todo-operations moves down. |
boolean |
isValidTodoPosition()
Tests if the todo-position is allowed. |
void |
setTodoPosition(int p)
Sets the border between init- and todo-operations manually. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OperationRecorder()
| Method Detail |
|---|
public void exerciseUpdate(ExerciseUpdateEvent e)
ExerciseUpdateListener
exerciseUpdate in interface ExerciseUpdateListenere - The eventpublic void add(java.lang.Object obj)
JedasPanel
obj - The executed operationpublic void clear()
public java.lang.Object getCurrentOperation()
public int getCurrentOffset()
public java.lang.Object getNextOperation()
null will be
returned.
public void goInTodoMode()
public int getPossibleTodoPosition(int newTodoPosition)
newTodoPosition - the new todo-position
public void decreaseTodoPosition()
increaseTodoPosition()public void increaseTodoPosition()
decreaseTodoPosition()public void setTodoPosition(int p)
p - new todo-positiongetTodoPosition(),
increaseTodoPosition(),
decreaseTodoPosition()public int getTodoPosition()
setTodoPosition(int),
increaseTodoPosition(),
decreaseTodoPosition()public boolean isValidTodoPosition()
public Failure getFirstFailure()
null if no failurepublic Failure getUnlimitedFailure(int offset)
offset - start of the search
null if no failurepublic Failure getLimitedFailure(int offset)
offset - start of the search
null if no failurepublic OperationQueue getInitOperationQueue()
OperationQueue.
Important:
getAllInitOperationQueue()public OperationQueue getAllInitOperationQueue()
OperationQueue.
Important:
getInitOperationQueue()public OperationQueue getTodoOperationQueue()
OperationQueue.
Important:
getAllTodoOperationQueue()public OperationQueue getAllTodoOperationQueue()
OperationQueue.
Important:
getTodoOperationQueue()public java.util.Vector getInitOperations()
Vector.
Important:
getInitOperationQueue(),
getAllInitOperationQueue()public java.util.Vector getTodoOperations()
Vector.
Important:
getTodoOperationQueue(),
getAllTodoOperationQueue()public void addOperations(java.util.Vector v)
v - vector of operationspublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean canUndo()
public int getCurrentOperationNr()
public int getCurrentSubOperationNr()
public java.lang.Object getEntry(int offset)
offset -
public void addEntry(java.lang.Object o)
o - The new entrypublic int getOperationCount()
public int getOffset(int opnr,
int subopnr)
opnr - Operation-Numbersubopnr - SubOperation-Number inside Operation-Number
public SubOperation getSubOperation(int opnr,
int subopnr)
opnr - Operation-Numbersubopnr - SubOperation-Number
getCorrectSubOperation(int,int)
public SubOperation getCorrectSubOperation(int opnr,
int subopnr)
opnr - Operation-Numbersubopnr - SubOperation-Number
getSubOperation(int,int)public Operation getOperation(int opnr)
opnr - Operation-Number
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||