|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Vehicle
This class provides an implementation for a basic vehicle that has a vehicle identification number and the ability to sort based on that number.
Constructor Summary | |
Vehicle(int id)
Create a new Vehicle with the given vehicle identification number. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order, based on the vehicle identification number. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one, based on a comparison of vehicle id numbers. |
int |
getVIN()
Return the vehicle id number for this Vehicle. |
int |
hashCode()
Returns a hash code value for this Vehicle, namely the vehicle identification number. |
static void |
main(java.lang.String[] arg)
Test harness for this class. |
java.lang.String |
toString()
Provide a String representation of this Vehicle. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Vehicle(int id)
Method Detail |
public int getVIN()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- the other Vehicle object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other Vehicle object
public int hashCode()
hashCode
in class java.lang.Object
public static void main(java.lang.String[] arg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |