Package jasima.core.simulation
Class SimComponentContainerBase
- java.lang.Object
-
- jasima.core.simulation.SimComponentBase
-
- jasima.core.simulation.SimComponentContainerBase
-
- All Implemented Interfaces:
SimComponent,SimComponentContainer,SimLifecycleListener,SimOperations,Notifier<SimComponent,SimComponent.SimComponentEvent>,NotifierListener<Simulation,Simulation.SimLifecycleEvent>,ValueStore,Cloneable
- Direct Known Subclasses:
Shop,SimComponentRoot,SimEntity
public class SimComponentContainerBase extends SimComponentBase implements SimComponentContainer
Simple implementation of aSimComponentContainer.- Author:
- Torsten Hildebrandt
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jasima.core.simulation.SimComponent
SimComponent.ProduceResultsEvent, SimComponent.SimComponentEvent, SimComponent.SimComponentLifeCycleMessage
-
Nested classes/interfaces inherited from interface jasima.core.simulation.SimLifecycleListener
SimLifecycleListener.DoneListener, SimLifecycleListener.OtherListener, SimLifecycleListener.ResetStatsListener, SimLifecycleListener.ResultsListener, SimLifecycleListener.SimEndListener, SimLifecycleListener.SimInitialized, SimLifecycleListener.SimStartListener
-
Nested classes/interfaces inherited from interface jasima.core.simulation.util.SimOperations
SimOperations.SimEventType
-
-
Field Summary
-
Fields inherited from class jasima.core.simulation.SimComponentBase
sim
-
Fields inherited from interface jasima.core.simulation.SimComponent
NAME_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description SimComponentContainerBase()SimComponentContainerBase(String name, SimComponent... children)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimComponentContainerBaseaddChild(SimComponent... scs)Adds one or more child nodes to the container.voidaddComponent(SimComponent... scs)Convenience method to add a one or more new component(s) to the root component of this simulation.SimComponentContainerBaseclone()Public clone method.SimComponentgetChild(int index)Returns the child identified byindex.SimComponentgetChildByName(String name)Returns the child identified byname.List<SimComponent>getChildren()Returns a list of all child components of this container.intnumChildren()Returns the number of children currently contained in this container.booleanremoveChild(SimComponent sc)Removes a child from this container.voidremoveChildren()Removes all child nodes from this container.-
Methods inherited from class jasima.core.simulation.SimComponentBase
getHierarchicalName, getName, getParent, getSim, isInitialized, notifierImpl, setInitialized, setName, setNameInternal, setParent, setSim, toString, valueStoreImpl
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jasima.core.util.observer.Notifier
addListener, addListener, addListener, fire, fire, getListener, numListener, removeCurrentListener, removeListener
-
Methods inherited from interface jasima.core.simulation.SimComponent
addResult, containsChild, done, getHierarchicalName, getName, getParent, getSim, handleOther, inform, init, isInitialized, isValidName, notifierImpl, produceResults, resetStats, setInitialized, setName, setParent, setSim, simEnd, simStart, valueStoreImpl
-
Methods inherited from interface jasima.core.simulation.SimComponentContainer
componentSetHelper, getByHierarchicalName
-
Methods inherited from interface jasima.core.simulation.util.SimOperations
activateEntity, currentPrio, end, getRootComponent, initRndGen, initRndGen, isEndRequested, isTraceEnabled, schedule, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, schedulePeriodically, schedulePeriodically, scheduleProcess, scheduleProcess, simTime, simTimeAbs, simTimeToInstant, toSimTime, toSimTime, toSimTime, trace
-
Methods inherited from interface jasima.core.util.ValueStore
valueStoreContains, valueStoreGet, valueStoreGet, valueStoreGetAllKeys, valueStoreGetNumKeys, valueStorePut, valueStoreRemove, valueStoreUpdate
-
-
-
-
Constructor Detail
-
SimComponentContainerBase
public SimComponentContainerBase()
-
SimComponentContainerBase
public SimComponentContainerBase(String name, SimComponent... children)
-
-
Method Detail
-
getChildren
public List<SimComponent> getChildren()
Description copied from interface:SimComponentReturns a list of all child components of this container.- Specified by:
getChildrenin interfaceSimComponent
-
getChild
public SimComponent getChild(int index)
Description copied from interface:SimComponentReturns the child identified byindex.- Specified by:
getChildin interfaceSimComponent- Parameters:
index- the child's index (0-based; range: [0, numChildren-1])- Returns:
- The child.
-
getChildByName
@Nullable public SimComponent getChildByName(String name)
Description copied from interface:SimComponentReturns the child identified byname.- Specified by:
getChildByNamein interfaceSimComponent- Parameters:
name- The child's name.- Returns:
- The child;
nullif not found.
-
addChild
public SimComponentContainerBase addChild(SimComponent... scs)
Description copied from interface:SimComponentAdds one or more child nodes to the container.- Specified by:
addChildin interfaceSimComponent- Returns:
- the container itself (to allow chaining calls)
-
addComponent
public void addComponent(SimComponent... scs)
Description copied from interface:SimOperationsConvenience method to add a one or more new component(s) to the root component of this simulation.- Specified by:
addComponentin interfaceSimComponent- Specified by:
addComponentin interfaceSimOperations
-
removeChild
public boolean removeChild(SimComponent sc)
Description copied from interface:SimComponentRemoves a child from this container.- Specified by:
removeChildin interfaceSimComponent- Parameters:
sc- the child to remove- Returns:
- true, if the child was removed; false otherwise
-
removeChildren
public void removeChildren()
Description copied from interface:SimComponentRemoves all child nodes from this container.- Specified by:
removeChildrenin interfaceSimComponent
-
numChildren
public int numChildren()
Description copied from interface:SimComponentReturns the number of children currently contained in this container.- Specified by:
numChildrenin interfaceSimComponent
-
clone
public SimComponentContainerBase clone()
Description copied from interface:SimComponentPublic clone method. Implementing classes should implement a suitable functionality or throw aCloneNotSupportedExceptionwrapped in aRuntimeException.- Specified by:
clonein interfaceSimComponent- Specified by:
clonein interfaceSimComponentContainer- Overrides:
clonein classSimComponentBase
-
-