artisynth.core.modelbase
Class CompositeState

java.lang.Object
  extended by artisynth.core.modelbase.CompositeState
All Implemented Interfaces:
ComponentState, java.io.Serializable

public class CompositeState
extends java.lang.Object
implements ComponentState

See Also:
Serialized Form

Constructor Summary
CompositeState()
           
CompositeState(int capacity)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeState

public CompositeState()

CompositeState

public CompositeState(int capacity)
Method Detail

getStates

public java.util.Iterator<ComponentState> getStates()

getState

public ComponentState getState(int i)

addComponents

public void addComponents(java.util.Collection<? extends java.lang.Object> comps)

addComponent

public void addComponent(java.lang.Object comp)

getComponents

public java.util.ArrayList<java.lang.Object> getComponents()

numComponents

public int numComponents()

addState

public void addState(ComponentState state)

removeState

public void removeState(ComponentState state)

numSubStates

public int numSubStates()

clear

public void clear()

equals

public boolean equals(ComponentState state)
Returns true if this state equals another component state.

Specified by:
equals in interface ComponentState
Parameters:
state - state to compare to

writeBinary

public void writeBinary(java.io.DataOutputStream dos)
                 throws java.io.IOException
Description copied from interface: ComponentState
Writes this state (in binary format) to a data output stream.

Specified by:
writeBinary in interface ComponentState
Parameters:
dos - output stream to write model to
Throws:
java.io.IOException - if an I/O error occurred

readBinary

public void readBinary(java.io.DataInputStream dis)
                throws java.io.IOException
Description copied from interface: ComponentState
Read this state (in binary format) from a data input stream.

Specified by:
readBinary in interface ComponentState
Parameters:
dis - input stream to read model from
Throws:
java.io.IOException - if an I/O error occurred or if the input is incompatible with the current state configuration.

set

public void set(ComponentState stateToCopy)
Description copied from interface: ComponentState
Sets this state by copying the value from an existing state object.

Specified by:
set in interface ComponentState
Parameters:
stateToCopy - state object to copy

set

public void set(CompositeState state)

duplicate

public CompositeState duplicate()
Description copied from interface: ComponentState
Create a duplicate of this state which can be used for storing this state's values.

Specified by:
duplicate in interface ComponentState
Returns:
duplicate of this state

printState

public void printState(int indent)
Debugging method to print the structure of a composite state