|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a generic motor. Devices that implement this interface are free to define the meaning of the abstract concepts of speed, direction, start and stop as long as they make sense within the devices context.
Field Summary | |
static int |
DIRECTION_FORWARD
Direction identifier for "forward". |
static int |
DIRECTION_REVERSE
Direction identifier for "reverse". |
Method Summary | |
int |
getDirection()
Returns the direction attribute. |
int |
getSpeed()
Gets the speed attribute of the Motor object. |
void |
setDirection(int direction)
Sets the direction attribute of the motor. |
void |
setSpeed(int speed)
Sets the speed attribute of the Motor object. |
void |
start()
Starts the motor. |
void |
stop()
Stops the motor. |
Methods inherited from interface cork.device.Device |
getDeviceDestription, getDeviceName |
Field Detail |
public static final int DIRECTION_FORWARD
The direction "forward" is an abstract concept and the implementing device is free to choose what forward means in it's particular context.
public static final int DIRECTION_REVERSE
The direction "reverse" is an abstract concept and the implementing device is free to choose what reverse means in it's particular context.
Method Detail |
public void start()
public void stop()
public void setDirection(int direction)
direction
- int the direction id from this interface.public int getDirection()
public void setSpeed(int speed)
speed
- int The new speed valuepublic int getSpeed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |