        /** Definition of a Ship's position and course.
         *  @author David J. Barnes (d.j.barnes@ukc.ac.uk)
         *  @version Version 2.0 (14th Apr 1999)<br>
         *  @see Ship
         */
public class CourseAndPosition {
        /** Set the immutable attributes
         */
    public CourseAndPosition(double course,Position position){
        this.course = course;
        this.position = position;
    }

        /** Return the position.
         */
    public Position getPosition(){
        return position;
    }

        /** Return the course.
         */
    public double getCourse(){
        return course;
    }

        /** Does this course and position match another?
         *  @return true if <i>o</i> is a CourseAndPosition
         *  with matching <i>course</i> and <i>position</i>
         *  attributes.
         */
    public boolean equals(Object o){
        if(o == null){
            return false;
        }
        else if(!(o instanceof CourseAndPosition)){
            return false;
        }
        else{
            CourseAndPosition p = (CourseAndPosition) o;
            return p.equals(getPosition()) && (p.getCourse() == getCourse());
        }
    }

    private final Position position;
    private final double course;
}


