|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ridgesoft.robotics.Compass
public abstract class Compass
Abstract base class for a compass sensor.
Constructor Summary | |
---|---|
protected |
Compass()
Constructs a Compass. |
Method Summary | |
---|---|
String |
direction()
Gets a String indicating the current compass direction. |
static String |
direction(int heading)
Converts a compass heading to a String indicating a compass direction. |
abstract int |
heading()
Reads the current heading from the compass. |
String |
toString()
Returns a String containing the current heading in degrees. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait |
Constructor Detail |
---|
protected Compass()
Method Detail |
---|
public String direction()
The returned String will be one of the following: "N", "NE", "E", "SE", "S", "SW", "W", "NW" or "--". The string "--" indicates the heading is not valid.
public static String direction(int heading)
The returned String will be one of the following: "N", "NE", "E", "SE", "S", "SW", "W", "NW" or "--". The string "--" indicates the heading is not valid.
heading
- compass heading in degrees (0 - 359)
public abstract int heading()
public String toString()
toString
in class Object
|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |