CLRA 0.1.2

com.clra.rowing
Class BoatView

java.lang.Object
  |
  +--com.clra.rowing.BoatView
All Implemented Interfaces:
Comparable, Serializable

public class BoatView
extends Object
implements Comparable, Serializable

Read-only information about a boat.

Version:
$Id: BoatView.java,v 1.2 2002/02/18 18:03:44 rphall Exp $
Author:
Rick Hall
See Also:
Serialized Form

Constructor Summary
BoatView(int id, String name, int size, String type)
           
 
Method Summary
 int compareTo(Object o)
          Defines a natural ordering for boats by name.
 boolean equals(Object o)
          Two boats are equal iff their id's are equal.
 int getId()
           
 String getName()
           
 int getSize()
           
 String getType()
           
 int hashCode()
          Boat objects are hashed by id's
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoatView

public BoatView(int id,
                String name,
                int size,
                String type)
         throws ValidationException
Method Detail

getId

public int getId()

getName

public String getName()

getSize

public int getSize()

getType

public String getType()

equals

public boolean equals(Object o)
Two boats are equal iff their id's are equal.
Overrides:
equals in class Object

hashCode

public int hashCode()
Boat objects are hashed by id's
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object o)
              throws ClassCastException
Defines a natural ordering for boats by name. Note: this class has a natural ordering that is inconsistent with equals. Equality is defined by boat id's, not by boat names.
Specified by:
compareTo in interface Comparable
Parameters:
o - A boat object.
Throws:
ClassCastException - if o is not a boat object.

CLRA 0.1.2