public class CompositeState extends java.lang.Object implements ComponentState
Constructor and Description |
---|
CompositeState() |
CompositeState(int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
addComponent(java.lang.Object comp) |
void |
addComponents(java.util.Collection<? extends java.lang.Object> comps) |
void |
addState(ComponentState state) |
void |
clear() |
CompositeState |
duplicate()
Create a duplicate of this state which can be used for storing this
state's values.
|
boolean |
equals(ComponentState state)
Returns true if this state equals another component state.
|
java.util.ArrayList<java.lang.Object> |
getComponents() |
ComponentState |
getState(int i) |
java.util.Iterator<ComponentState> |
getStates() |
int |
numComponents() |
int |
numSubStates() |
void |
printState(int indent)
Debugging method to print the structure of a composite state
|
void |
readBinary(java.io.DataInputStream dis)
Read this state (in binary format) from a data input stream.
|
void |
removeState(ComponentState state) |
void |
set(ComponentState stateToCopy)
Sets this state by copying the value from an existing state object.
|
void |
set(CompositeState state) |
void |
writeBinary(java.io.DataOutputStream dos)
Writes this state (in binary format) to a data output stream.
|
public CompositeState()
public CompositeState(int capacity)
public java.util.Iterator<ComponentState> getStates()
public ComponentState getState(int i)
public void addComponents(java.util.Collection<? extends java.lang.Object> comps)
public void addComponent(java.lang.Object comp)
public java.util.ArrayList<java.lang.Object> getComponents()
public int numComponents()
public void addState(ComponentState state)
public void removeState(ComponentState state)
public int numSubStates()
public void clear()
public boolean equals(ComponentState state)
equals
in interface ComponentState
state
- state to compare topublic void writeBinary(java.io.DataOutputStream dos) throws java.io.IOException
ComponentState
writeBinary
in interface ComponentState
dos
- output stream to write model tojava.io.IOException
- if an I/O error occurredpublic void readBinary(java.io.DataInputStream dis) throws java.io.IOException
ComponentState
readBinary
in interface ComponentState
dis
- input stream to read model fromjava.io.IOException
- if an I/O error occurred or if the input is incompatible with the current
state configuration.public void set(ComponentState stateToCopy)
ComponentState
set
in interface ComponentState
stateToCopy
- state object to copypublic void set(CompositeState state)
public CompositeState duplicate()
ComponentState
duplicate
in interface ComponentState
public void printState(int indent)