pacworld
Class Package

java.lang.Object
  extended by pacworld.Package

public class Package
extends java.lang.Object

A package for the package delivery world.


Constructor Summary
Package(int i, int destId, int destX, int destY)
          Create a package by specifying its id and destination.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 PacAgentRep getAgent()
          Return the agent that is holding the package.
 int getDestId()
           
 int getDestX()
           
 int getDestY()
           
 int getId()
           
 int getX()
           
 int getY()
           
 void setAgent(PacAgentRep agt)
           
 void setX(int newX)
           
 void setY(int newY)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Package

public Package(int i,
               int destId,
               int destX,
               int destY)
Create a package by specifying its id and destination.

Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getAgent

public PacAgentRep getAgent()
Return the agent that is holding the package. Return null if no agent is holding it.

Returns:

getDestId

public int getDestId()

getDestX

public int getDestX()

getDestY

public int getDestY()

getId

public int getId()

getX

public int getX()

getY

public int getY()

setAgent

public void setAgent(PacAgentRep agt)

setX

public void setX(int newX)

setY

public void setY(int newY)