|
|||||||||
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
public abstract class OperandVector
This class models a vector of operands. Operands and Work are vectors of operands.
Operand
,
Work
,
Serialized FormConstructor Summary | |
---|---|
OperandVector()
|
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 OperandVector()
Method Detail |
---|
public void setChild(Operand newChild, int atIndex)
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.
newChild
- the new childatIndex
- the index to where newChild goes
java.lang.ArrayIndexOutOfBoundsException
- if atIndex
is an invalid index. (For leaf nodes, all indexes are invalid.)public Operand getChild(int atIndex)
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.
atIndex
- the index at where a child will be sought.
java.lang.ArrayIndexOutOfBoundsException
- if atIndex
is an invalid index. (For leaf nodes, all indexes are invalid.)public void addChild(Operand newChild, int atIndex)
public Operand delChild(int atIndex)
public java.util.Enumeration getChildren()
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.
public int countChildren()
This default implementation returns zero, as a leaf node has no child.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |