|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--world.Sack
Class that implements a container for packages.
Constructor Summary | |
Sack()
Creates a sack. |
Method Summary | |
void |
empty()
Method to clear all packages (empty) from the sack. |
int |
getCount()
Method to get the sack's package count. |
Pkg[] |
getPkgs()
Method to get the sack's packages. |
TableModel |
getTableModel()
Returns a table model for displaying the sack. |
int |
getWeight()
Method to get the sack's total weight. |
Pkg |
put(Pkg pkg)
Method to add a package to the sack. |
Pkg |
remove(int id)
Method to remove a package from a the sack. |
Pkg |
remove(Pkg pkg)
Method to remove a package from a the sack. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Sack()
Method Detail |
public int getCount()
public int getWeight()
public Pkg[] getPkgs()
public Pkg put(Pkg pkg)
pkg
- The package to add to the sack.public Pkg remove(int id)
id
- The package ID of the package to remove
from the sack.public Pkg remove(Pkg pkg)
pkg
- The package to remove from the sack.public void empty()
public TableModel getTableModel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |