world
Class Pkg
java.lang.Object
|
+--world.Pkg
- All Implemented Interfaces:
- Comparable, ID
- public class Pkg
- extends Object
- implements ID
Class that implements packages for the ICFP-2002 programming contest
entry.
- Version:
- $Revision: 1.2 $
- Author:
- Allen D. Ball
Constructor Summary |
Pkg(int id,
int weight,
Tile destination)
Creates a package. |
Method Summary |
int |
compareTo(Object object)
Compares this object with the specified object for order. |
Tile |
getDestination()
Method to get the package's destination position. |
int |
getId()
Method to get the package ID. |
int |
getWeight()
Method to get the package's weight. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Pkg
public Pkg(int id,
int weight,
Tile destination)
- Creates a package.
- Parameters:
id
- The package ID.weight
- The package's weight.destination
- The package's destination position.
getId
public int getId()
- Method to get the package ID.
- Specified by:
getId
in interface ID
- Returns:
- The package ID.
getWeight
public int getWeight()
- Method to get the package's weight.
- Returns:
- The package's weight.
getDestination
public Tile getDestination()
- Method to get the package's destination position.
- Returns:
- The package's destination position.
compareTo
public int compareTo(Object object)
- Compares this object with the specified object for order.
Returns a negative integer, zero, or a positive integer as this
object is less than, equal to, or greater than the specified
object.
- Specified by:
compareTo
in interface Comparable
- Parameters:
object
- The object to be compared.- See Also:
Comparable
Copyright 2002 Allen D. Ball. All rights reserved.