Class CourseAndPosition
java.lang.Object
|
+--CourseAndPosition
- public class CourseAndPosition
- extends java.lang.Object
Definition of a Ship's position and course.
- See Also:
Ship
Method Summary |
boolean |
equals(java.lang.Object o)
Does this course and position match another? |
double |
getCourse()
Return the course. |
Position |
getPosition()
Return the position. |
Methods inherited from class java.lang.Object |
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
CourseAndPosition
public CourseAndPosition(double course,
Position position)
- Set the immutable attributes
getPosition
public Position getPosition()
- Return the position.
getCourse
public double getCourse()
- Return the course.
equals
public boolean equals(java.lang.Object o)
- Does this course and position match another?
- Returns:
- true if o is a CourseAndPosition
with matching course and position
attributes.
- Overrides:
- equals in class java.lang.Object