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

getAgent

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

Returns:

getId

public int getId()

getDestId

public int getDestId()

getDestX

public int getDestX()

getDestY

public int getDestY()

getX

public int getX()

getY

public int getY()

setX

public void setX(int newX)

setY

public void setY(int newY)

setAgent

public void setAgent(PacAgentRep agt)

equals

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