Class RobotColor
java.lang.Object
|
+--Enumerate
|
+--RobotColor
- All Implemented Interfaces:
- java.io.Serializable
- public class RobotColor
- extends Enumerate
The RobotColor class extends the Enumerate class and represents the
four colors a Robot can be.
The colors are:
1. Blue
2. Red
3. Green
4. Yellow
- See Also:
- Serialized Form
Constructor Summary |
RobotColor(java.lang.String name)
Constructor - calls the constructor of the Enumerate class that
RobotColor inherits. |
Methods inherited from class Enumerate |
get, get, getName, iterator, pos, readResolve, size, toArray, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BLUE
public static final RobotColor BLUE
RED
public static final RobotColor RED
GREEN
public static final RobotColor GREEN
YELLOW
public static final RobotColor YELLOW
RobotColor
public RobotColor(java.lang.String name)
Constructor - calls the constructor of the Enumerate class that
RobotColor inherits.
- Parameters:
name
- the name of the direction: blue, red, green or yellow
getColor
public RobotColor getColor()
- Returns the current color
- Returns:
- RobotColor color - the current color selected
setColor
public void setColor(RobotColor newColor)
- Sets the current color to the parameter passed
- Parameters:
newColor
- the new color to set color to