|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.xal.model.elem.ElementSeq
Convenience abstract base class for a composite modeling element. The
composite is represented as a sequence of modeling elements, perhaps other
composites. Specifically we have an ordered list of child modeling elements.
Propagation of probes (objects exposing the IProbe interface)
is done by passing it sequentially to each child. Of couse if a child is
also a composite the same is done there.
| Field Summary | |
static int |
s_szDefReserve
default number of element positions to reserve in list array |
| Constructor Summary | |
ElementSeq(java.lang.String strType)
Creates a new instance of ElementSeq without a sequence identifier. |
|
ElementSeq(java.lang.String strType,
java.lang.String strId)
Creates a new instance of ElementSeq |
|
ElementSeq(java.lang.String strType,
java.lang.String strId,
int szReserve)
Creates a new instance of ElementSeq and reserves space for a szReserve length sequence. |
|
| Method Summary | |
void |
addChild(IComponent iComp)
Add a component object at the tail of the sequence. |
java.util.Iterator |
childIterator()
Return an Iterator object that cycles through
all the direct children of the sequence. |
void |
concatenateEquals(ElementSeq seq)
Concatenate the indicated ElementSeq object
to the tail of this sequence. |
IComponent |
getChild(int indChild)
Get the child IComponent interface at location specified by index. |
int |
getChildCount()
Get the number of direct children in this sequence. |
java.lang.String |
getComments()
Get any user comments regarding this sequence. |
java.lang.String |
getId()
Get the sequence identifier |
int |
getLeafCount()
Get the number of Element derived objects contained
in this sequence. |
double |
getLength()
Return the length of the sequence. |
java.lang.String |
getType()
Get the type identifier for the composite element. |
java.util.Iterator |
globalIterator()
Return an Iterator object that iterates over every
IComponent object in this composite. |
java.util.Iterator |
localIterator()
Return an Iterator object that iterates over the direct
descendants only of this composite element, in order. |
void |
print(java.io.PrintWriter os)
Dump contents to a text stream. |
void |
propagate(IProbe probe)
Propagate probe through sequence |
boolean |
remove(IComponent iElem)
Remove an element from the entire tree. |
void |
setComments(java.lang.String strComment)
Sets any user comment associated with this sequence. |
void |
setId(java.lang.String strId)
Set the string identifier for the element. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int s_szDefReserve
| Constructor Detail |
public ElementSeq(java.lang.String strType)
public ElementSeq(java.lang.String strType,
java.lang.String strId)
strId - identifier of the sequence
public ElementSeq(java.lang.String strType,
java.lang.String strId,
int szReserve)
strId - identifier of the sequenceszReserve - number of Element spaces to reserve| Method Detail |
public void setId(java.lang.String strId)
strId - new string identifier for elementpublic void setComments(java.lang.String strComment)
strComment - string containing user commentspublic java.lang.String getType()
getType in interface IComponentpublic java.lang.String getId()
getId in interface IComponentpublic double getLength()
getLength in interface IComponent
public void propagate(IProbe probe)
throws ModelException
propagate in interface ICompositeprobe - the state of the probe will be advance using the elements dynamics
ModelException - an error occurred while advancing the probe statepublic java.util.Iterator localIterator()
Iterator object that iterates over the direct
descendants only of this composite element, in order.
localIterator in interface ICompositeIteratorpublic java.util.Iterator globalIterator()
Iterator object that iterates over every
IComponent object in this composite. For
IComponent which are also composite the parent is
returned first, then all its children. This would be the order in
which the probe visits each component.
globalIterator in interface ICompositeIterator interface to iterator objectIteratorpublic int getChildCount()
getChildCount in interface ICompositepublic IComponent getChild(int indChild)
getChild in interface ICompositeindChild - position index within the sequence list
public void addChild(IComponent iComp)
addChild in interface ICompositeiComp - new component objectpublic boolean remove(IComponent iElem)
remove in interface ICompositeiElem - interface to the child to be removed
public java.lang.String getComments()
public int getLeafCount()
Element derived objects contained
in this sequence.
Element object w/in sequencepublic java.util.Iterator childIterator()
Iterator object that cycles through
all the direct children of the sequence. Note that any child
may have children itself.
IElement interfacespublic void concatenateEquals(ElementSeq seq)
ElementSeq object
to the tail of this sequence.
seq - object to conjoin to this onepublic void print(java.io.PrintWriter os)
os - output stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||