| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.mazewar.Direction
public class Direction
A representation of the for Cardinal Directions with associated utility methods.
| Field Summary | |
|---|---|
| static Direction | EastThe Eastward Cardinal Direction. | 
| static Direction | NorthThe Northward Cardinal Direction. | 
| static Direction | SouthThe Southward Cardinal Direction. | 
| static Direction | WestThe Westward Cardinal Direction. | 
| Constructor Summary | |
|---|---|
| Direction(int direction)Create a new direction from an internal representation | |
| Method Summary | |
|---|---|
|  boolean | equals(java.lang.Object o)Compare Directions for equality. | 
|  int | getDirection() | 
|  Direction | invert()Create a new direction by rotating this one one hundred eighty degrees. | 
| static Direction | random()Create a Directionrandomly. | 
|  java.lang.String | toString()Produce a Stringrepresentation of a direction. | 
|  Direction | turnLeft()Create a new Directionby rotating this one 
 ninety degrees counter-clockwise. | 
|  Direction | turnRight()Create a new Directionby rotating this one
 ninety degrees clockwise. | 
| Methods inherited from class java.lang.Object | 
|---|
| getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final Direction North
Direction.
public static final Direction East
Direction.
public static final Direction South
Direction.
public static final Direction West
Direction.
| Constructor Detail | 
|---|
public Direction(int direction)
| Method Detail | 
|---|
public int getDirection()
public boolean equals(java.lang.Object o)
Directions for equality.
equals in class java.lang.Objectpublic static Direction random()
Direction randomly.
Direction.public Direction turnLeft()
Direction by rotating this one 
 ninety degrees counter-clockwise.
Direction resulting from turning left.public Direction turnRight()
Direction by rotating this one
 ninety degrees clockwise.
Direction resulting from turning right.public Direction invert()
Direction that has been flipped.public java.lang.String toString()
String representation of a direction.
toString in class java.lang.ObjectDirection's String representation.| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||