org.robokind.api.motion.utils
Class DefaultJointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.utils.DefaultJointGroupConfig<Id,GroupConfig>
Type Parameters:
Id - type used to identify Joints
GroupConfig - JointGroupConfig used to create children JointGroups
All Implemented Interfaces:
org.robokind.api.common.property.PropertyChangeSource, JointGroupConfig<Id,GroupConfig>

public class DefaultJointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
extends org.robokind.api.common.property.PropertyChangeNotifier
implements JointGroupConfig<Id,GroupConfig>

Default implementation of a JointGroupConfig

Author:
Matthew Stevenson

Field Summary
 
Fields inherited from interface org.robokind.api.motion.utils.JointGroupConfig
PROP_ADD_JOINT_GROUP, PROP_ADD_JOINT_ID, PROP_ENABLED, PROP_NAME, PROP_REMOVE_JOINT_GROUP, PROP_REMOVE_JOINT_ID
 
Constructor Summary
DefaultJointGroupConfig(String name)
          Creates an empty DefaultJointGroupConfig with the given name.
DefaultJointGroupConfig(String name, List<? extends Id> ids, List<? extends GroupConfig> groups)
          Creates a new DefaultJointGroupConfig with the given values
 
Method Summary
 void addGroup(GroupConfig group)
          Add a child JointGroupConfig.
 void addJointId(Id jointId)
          Adds a JointId to the JointGroupConfig
 boolean getEnabled()
          Returns the default enabled state
 int getGroupCount()
          Return the number of child JointGroupConfigs.
 int getJointCount()
          Returns the number of JointIds for this JointGroupConfig.
 GroupConfig getJointGroup(int index)
          Returns the child JointGroupConfig at the given index.
 List<GroupConfig> getJointGroups()
          Returns a List of the children JointGroupConfigs.
 Id getJointId(int index)
          Returns the JointId at the given index.
 List<Id> getJointIds()
          Returns a List of JointIds for this JointGroup
 String getName()
          Returns the name to use
 void insertGroup(GroupConfig group, int index)
          Add a child JointGroupConfig at the given index.
 void insertJointId(Id jointId, int index)
          Adds a JointId at the given index
 void removeGroup(GroupConfig group)
          Removes a child JointGroupConfig.
 void removeGroupAt(int index)
          Removes a child JointGroupConfig at the given index.
 void removeJointId(Id jointId)
          Removes a JointId
 void removeJointIdAt(int index)
          Removes the JointId with the given index.
 void setEnabled(boolean enabled)
          Sets the default enabled state of the JointGroup
 void setName(String name)
          Sets the name of the JointGroup
 String toString()
           
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.robokind.api.common.property.PropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DefaultJointGroupConfig

public DefaultJointGroupConfig(String name)
Creates an empty DefaultJointGroupConfig with the given name.

Parameters:
name - name for the JointGroup

DefaultJointGroupConfig

public DefaultJointGroupConfig(String name,
                               List<? extends Id> ids,
                               List<? extends GroupConfig> groups)
Creates a new DefaultJointGroupConfig with the given values

Parameters:
name - name for the JointGroup
ids - initial JointIds
groups - initial child JointGroupConfigs
Method Detail

setName

public void setName(String name)
Description copied from interface: JointGroupConfig
Sets the name of the JointGroup

Specified by:
setName in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
name - new name to use

getName

public String getName()
Description copied from interface: JointGroupConfig
Returns the name to use

Specified by:
getName in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Returns:
the name to use

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: JointGroupConfig
Sets the default enabled state of the JointGroup

Specified by:
setEnabled in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
enabled - default enabled state to use

getEnabled

public boolean getEnabled()
Description copied from interface: JointGroupConfig
Returns the default enabled state

Specified by:
getEnabled in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Returns:
the default enabled state

addJointId

public void addJointId(Id jointId)
Description copied from interface: JointGroupConfig
Adds a JointId to the JointGroupConfig

Specified by:
addJointId in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
jointId - id to add

insertJointId

public void insertJointId(Id jointId,
                          int index)
Description copied from interface: JointGroupConfig
Adds a JointId at the given index

Specified by:
insertJointId in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
jointId - id to add
index - index for the jointId

removeJointId

public void removeJointId(Id jointId)
Description copied from interface: JointGroupConfig
Removes a JointId

Specified by:
removeJointId in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
jointId - id to remove

removeJointIdAt

public void removeJointIdAt(int index)
Description copied from interface: JointGroupConfig
Removes the JointId with the given index.

Specified by:
removeJointIdAt in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
index - position of the JointId in this JointGroupConfig's JointIds

getJointIds

public List<Id> getJointIds()
Description copied from interface: JointGroupConfig
Returns a List of JointIds for this JointGroup

Specified by:
getJointIds in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Returns:
a List of JointIds for this JointGroup

getJointId

public Id getJointId(int index)
Description copied from interface: JointGroupConfig
Returns the JointId at the given index.

Specified by:
getJointId in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
index - position of the JointId in the JointGroupConfig's JointIds
Returns:
the JointId at the given index

getJointCount

public int getJointCount()
Description copied from interface: JointGroupConfig
Returns the number of JointIds for this JointGroupConfig.

Specified by:
getJointCount in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Returns:
the number of JointIds for this JointGroupConfig

addGroup

public void addGroup(GroupConfig group)
Description copied from interface: JointGroupConfig
Add a child JointGroupConfig.

Specified by:
addGroup in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
group - child JointGroupConfig to add

insertGroup

public void insertGroup(GroupConfig group,
                        int index)
Description copied from interface: JointGroupConfig
Add a child JointGroupConfig at the given index.

Specified by:
insertGroup in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
group - child JointGroupConfig to add
index - position to add the child

removeGroup

public void removeGroup(GroupConfig group)
Description copied from interface: JointGroupConfig
Removes a child JointGroupConfig.

Specified by:
removeGroup in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
group - the child to remove

removeGroupAt

public void removeGroupAt(int index)
Description copied from interface: JointGroupConfig
Removes a child JointGroupConfig at the given index.

Specified by:
removeGroupAt in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
index - position of the child to remove

getJointGroups

public List<GroupConfig> getJointGroups()
Description copied from interface: JointGroupConfig
Returns a List of the children JointGroupConfigs.

Specified by:
getJointGroups in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Returns:
a List of the children JointGroupConfigs

getJointGroup

public GroupConfig getJointGroup(int index)
Description copied from interface: JointGroupConfig
Returns the child JointGroupConfig at the given index.

Specified by:
getJointGroup in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Parameters:
index - position to the child to remove
Returns:
the child JointGroupConfig removed

getGroupCount

public int getGroupCount()
Description copied from interface: JointGroupConfig
Return the number of child JointGroupConfigs.

Specified by:
getGroupCount in interface JointGroupConfig<Id,GroupConfig extends JointGroupConfig<Id,? extends GroupConfig>>
Returns:
the number of child JointGroupConfigs

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.