de.jaetzold.art.platform
Class BaseActuatorPort
java.lang.Object
|
+--de.jaetzold.art.platform.BaseSensorPort
|
+--de.jaetzold.art.platform.BaseActuatorPort
- All Implemented Interfaces:
- ActuatorPort, Port, SensorPort
- Direct Known Subclasses:
- AWTRobotInterface.AWTActuatorPort
- public abstract class BaseActuatorPort
- extends BaseSensorPort
- implements ActuatorPort
Base class for easy implementation of the interface ActuatorPort
.
The only thing required is to feed the contructor with the desired parameters and implement the factory-method for the peers: getPeerFor(Actuator)
Field Summary |
protected String |
type
Default is an empty String. |
Constructor Summary |
BaseActuatorPort()
Constructs a new ActuatorPort with dumb default values for it's properties. |
BaseActuatorPort(RobotInterface iface,
Object identifier,
int portNumber,
String type,
double minimumValue,
double maximumValue,
long granularity,
Port[] excludedPorts)
Constructs a new ActuatorPort with the given values for it's properties. |
Methods inherited from class de.jaetzold.art.platform.BaseSensorPort |
conformsTo, connectWith, disconnect, equals, getExcludedPorts, getGranularity, getMaximumValue, getMinimumValue, getPeerFor, getPortID, getPortNumber, toString |
type
protected String type
- Default is an empty String.
BaseActuatorPort
public BaseActuatorPort()
- Constructs a new ActuatorPort with dumb default values for it's properties. The properties are described in more detail in the description of the interfaces
ActuatorPort
and SensorPort
- See Also:
SensorPort
,
ActuatorPort
BaseActuatorPort
public BaseActuatorPort(RobotInterface iface,
Object identifier,
int portNumber,
String type,
double minimumValue,
double maximumValue,
long granularity,
Port[] excludedPorts)
- Constructs a new ActuatorPort with the given values for it's properties. The properties are described in more detail in the description of the interfaces
ActuatorPort
and SensorPort
- See Also:
SensorPort
,
ActuatorPort
connectWith
public void connectWith(Actuator actuator)
- Description copied from interface:
ActuatorPort
- Connects the given Actuator to this port.
This sets the peer for the Actuator and disconnects it from any other
port it was previously connected to.
- Specified by:
connectWith
in interface ActuatorPort
disconnect
public void disconnect(Actuator actuator)
- Description copied from interface:
ActuatorPort
- Disconnects the given Actuator from this port. If this has been the
last Actuator connected with this port it will automatically become
disabled, that means all associated resources are freed.
- Specified by:
disconnect
in interface ActuatorPort
getType
public String getType()
- Description copied from interface:
ActuatorPort
- Returns the type of this port as a String. Typical types could be "DC" or "Variable". This feature is not fully used and for now the String should be in some human-understandable form.
- Specified by:
getType
in interface ActuatorPort
getPeerFor
public abstract ActuatorPeer getPeerFor(Actuator actuator)
- This is the Factory-method for creating peers. It must be implemented by non-abstract subclasses.
- Specified by:
getPeerFor
in interface ActuatorPort
- Following copied from interface:
de.jaetzold.art.ActuatorPort
- See Also:
ActuatorPort.connectWith(Actuator)
,
RawActuator.connectWith(ActuatorPort)