org.robokind.api.motion.servos.config
Class DefaultServoConfig<Id>

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.servos.config.DefaultServoConfig<Id>
Type Parameters:
Id - Servo Id Type used
All Implemented Interfaces:
org.robokind.api.common.property.PropertyChangeSource, ServoConfig<Id>

public class DefaultServoConfig<Id>
extends org.robokind.api.common.property.PropertyChangeNotifier
implements ServoConfig<Id>

Default implementation for ServoConfig. The DefaultServoConfig adds a PhysicalId property.

Author:
Matthew Stevenson

Field Summary
 
Fields inherited from interface org.robokind.api.motion.servos.config.ServoConfig
PROP_DEF_POSITION, PROP_ID, PROP_MAX_POSITION, PROP_MIN_POSITION, PROP_NAME
 
Constructor Summary
DefaultServoConfig(Id servoId, String name, int minPos, int maxPos, int defPos)
          Creates a new ServoConfig with the given parameters.
 
Method Summary
 int getDefaultPosition()
          Returns the Servo default position.
 int getMaxPosition()
          Returns the Servo maximum position.
 int getMinPosition()
          Returns the Servo minimum position.
 String getName()
          Returns the Servo name.
 Id getServoId()
          Returns the Servo id.
 void setDefaultPosition(Integer pos)
          Sets the Servo default position.
 void setMaxPosition(Integer pos)
          Sets the Servo maximum position.
 void setMinPosition(Integer pos)
          Sets the Servo minimum position.
 void setName(String name)
          Sets the Servo name.
 void setServoId(Id id)
          Sets the Servo id.
 
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, toString, wait, wait, wait
 
Methods inherited from interface org.robokind.api.common.property.PropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DefaultServoConfig

public DefaultServoConfig(Id servoId,
                          String name,
                          int minPos,
                          int maxPos,
                          int defPos)
Creates a new ServoConfig with the given parameters.

Parameters:
servoId - The Servo's Id with respect to the ServoController
name - Servo name (used for display purposes)
minPos - minimum position in absolute terms for the ServoController
maxPos - maximum position in absolute terms for the ServoController
defPos - default position in absolute terms for the ServoController
Method Detail

getServoId

public Id getServoId()
Returns the Servo id.

Specified by:
getServoId in interface ServoConfig<Id>
Returns:
Servo id

setServoId

public void setServoId(Id id)
Sets the Servo id.

Specified by:
setServoId in interface ServoConfig<Id>
Parameters:
id - new Servo id

getName

public String getName()
Returns the Servo name.

Specified by:
getName in interface ServoConfig<Id>
Returns:
Servo name

setName

public void setName(String name)
Sets the Servo name.

Specified by:
setName in interface ServoConfig<Id>
Parameters:
name - new Servo name

getMinPosition

public int getMinPosition()
Returns the Servo minimum position.

Specified by:
getMinPosition in interface ServoConfig<Id>
Returns:
Servo minimum position

setMinPosition

public void setMinPosition(Integer pos)
Sets the Servo minimum position.

Specified by:
setMinPosition in interface ServoConfig<Id>
Parameters:
pos - new Servo minimum position

getMaxPosition

public int getMaxPosition()
Returns the Servo maximum position.

Specified by:
getMaxPosition in interface ServoConfig<Id>
Returns:
Servo maximum position

setMaxPosition

public void setMaxPosition(Integer pos)
Sets the Servo maximum position.

Specified by:
setMaxPosition in interface ServoConfig<Id>
Parameters:
pos - new Servo maximum position

getDefaultPosition

public int getDefaultPosition()
Returns the Servo default position.

Specified by:
getDefaultPosition in interface ServoConfig<Id>
Returns:
Servo default position

setDefaultPosition

public void setDefaultPosition(Integer pos)
Sets the Servo default position.

Specified by:
setDefaultPosition in interface ServoConfig<Id>
Parameters:
pos - new Servo default position


Copyright © 2011. All Rights Reserved.