public class SFRComposite extends SFRComponent implements Composite
The SFRComposite class represents all reactor components that can store and manage SFRComponents. This class implements the ICE Composite interface. This class was designed as a "branch" within the Reactor package to hold references to other SFRComponents.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
SFRComposite()
Nullary constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component child)
Adds the specified Component to the SFRComposite.
|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(SFRComposite otherObject)
Deep copies the contents of the object from another object.
|
boolean |
equals(java.lang.Object otherObject)
Compares the contents of objects and returns true if they are identical,
otherwise returns false.
|
Component |
getComponent(int childId)
Returns the SFRComponent of the specified ID, from
the SFRComposite.
|
SFRComponent |
getComponent(java.lang.String name)
Returns the SFRComponent of the specified name
|
java.util.ArrayList<java.lang.String> |
getComponentNames()
Returns a string ArrayList of all SFRComponent names contained in the
SFRComposite.
|
java.util.ArrayList<Component> |
getComponents()
Returns an ArrayList of SFRComponents contained in
the SFRComposite.
|
int |
getNumberOfComponents()
Returns the number of SFRComponents contained in
the SFRComposite, as an integer.
|
int |
hashCode()
Returns the hashCode of the object.
|
void |
removeComponent(int childId)
Removes the component specified by the ID, from
the SFRComposite.
|
void |
removeComponent(java.lang.String name)
Removes the component with the specified name.
|
accept, accept, addData, copy, getCurrentTime, getDataAtCurrentTime, getDescription, getFeatureList, getFeaturesAtCurrentTime, getId, getName, getNumberOfTimeSteps, getSourceInfo, getTimes, getTimeStep, getTimeUnits, notifyListeners, register, removeDataFromFeature, setDescription, setId, setName, setSourceInfo, setTime, setTimeUnits, toString, unregister, update
register, unregister, update
getDescription, getId, getName, setDescription, setId, setName
public SFRComponent getComponent(java.lang.String name)
Returns the SFRComponent of the specified name
name
- Name of the SFRComponent. Cannot be null.public java.util.ArrayList<java.lang.String> getComponentNames()
Returns a string ArrayList of all SFRComponent names contained in the SFRComposite.
public void removeComponent(java.lang.String name)
Removes the component with the specified name.
name
- Name of the SFRComponent to be removed.public void addComponent(Component child)
addComponent
in interface Composite
child
- The child component to add to the SFRComposite. Cannot be
null.Composite.addComponent(Component child)
public void removeComponent(int childId)
removeComponent
in interface Composite
childId
- The ID of the component to the removed.Composite.removeComponent(int childId)
public Component getComponent(int childId)
getComponent
in interface Composite
childId
- The ID of the SFRComponent to be returned.Composite.getComponent(int childId)
public int getNumberOfComponents()
getNumberOfComponents
in interface Composite
Composite.getNumberOfComponents()
public java.util.ArrayList<Component> getComponents()
getComponents
in interface Composite
Composite.getComponents()
public boolean equals(java.lang.Object otherObject)
Compares the contents of objects and returns true if they are identical, otherwise returns false.
equals
in interface Identifiable
equals
in class SFRComponent
otherObject
- The other object to compare against.Identifiable.equals(Object otherObject)
public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class SFRComponent
Identifiable.hashCode()
public void copy(SFRComposite otherObject)
Deep copies the contents of the object from another object.
otherObject
- The object to be copied from.public java.lang.Object clone()
Deep copies and returns a newly instantiated object.
clone
in interface Identifiable
clone
in class SFRComponent