Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.clra.rowing
Class BoatView  view BoatView download BoatView.java

java.lang.Object
  extended bycom.clra.rowing.BoatView
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class BoatView
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Read-only information about a boat.

Version:
$Id: BoatView.java,v 1.3 2003/02/26 03:38:45 rphall Exp $

Field Summary
private  int hashCode
           
private  int id
           
private  java.lang.String name
           
private  int size
           
private  java.lang.String type
           
 
Constructor Summary
BoatView(int id, java.lang.String name, int size, java.lang.String type)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Defines a natural ordering for boats by name.
 boolean equals(java.lang.Object o)
          Two boats are equal iff their id's are equal.
 int getId()
           
 java.lang.String getName()
           
 int getSize()
           
 java.lang.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
 

Field Detail

id

private int id

name

private java.lang.String name

size

private int size

type

private java.lang.String type

hashCode

private int hashCode
Constructor Detail

BoatView

public BoatView(int id,
                java.lang.String name,
                int size,
                java.lang.String type)
         throws com.clra.util.ValidationException
Method Detail

getId

public int getId()

getName

public java.lang.String getName()

getSize

public int getSize()

getType

public java.lang.String getType()

equals

public boolean equals(java.lang.Object o)
Two boats are equal iff their id's are equal.


hashCode

public int hashCode()
Boat objects are hashed by id's


compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.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 java.lang.Comparable