|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
scphEditor.CloneableObservable
scphEditor.OperandVector
scphEditor.Work
public class Work
This class models an scphEditor document, a list of operands and stuff.
When a Work object changes, it will call notifyOberservers() with an Integer object as a parameter:
Constructor Summary | |
---|---|
Work()
Constructor. |
Method Summary | |
---|---|
void |
addChild(Operand newChild,
int atIndex)
|
int |
countChildren()
Gives the actual, present number of my children. |
Operand |
delChild(int atIndex)
|
Operand |
getChild(int atIndex)
Gives my child at the given index. |
java.util.Enumeration |
getChildren()
Enumerates all of my children, in ascending order of indexes. |
void |
setChild(Operand newChild,
int atIndex)
Adopts the given new child as my child at the given index, replacing the previous child at the same index. |
Methods inherited from class scphEditor.CloneableObservable |
---|
addObserver, clone, cloneObserverList, cloneObserverList, countObservers, deleteObserver, deleteObservers, notifyObservers, notifyObservers |
Methods inherited from class java.util.Observable |
---|
clearChanged, hasChanged, setChanged |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Work()
Method Detail |
---|
public void setChild(Operand newChild, int atIndex)
OperandVector
This default implementation is for a leaf node in which there must be no child, so it always throws an exception. A compound expression must re-implement this method sensibly.
setChild
in class OperandVector
newChild
- the new childatIndex
- the index to where newChild goespublic void addChild(Operand newChild, int atIndex)
addChild
in class OperandVector
public Operand delChild(int atIndex)
delChild
in class OperandVector
public Operand getChild(int atIndex)
OperandVector
This default implementation is for a leaf node in which there is no child, so it always throws an exception. A compound expression must re-implement this method sensibly.
getChild
in class OperandVector
atIndex
- the index at where a child will be sought.
public java.util.Enumeration getChildren()
OperandVector
This default implementation returns an ``empty'' Enumeration, i.e., one that has no element at all, which makes sense for leaf nodes. A compound expression must override this behaviour sensibly.
getChildren
in class OperandVector
public int countChildren()
OperandVector
This default implementation returns zero, as a leaf node has no child.
countChildren
in class OperandVector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |