Class Wastebin
java.lang.Object
jadex.quickstart.cleanerworld.environment.impl.LocationObject
jadex.quickstart.cleanerworld.environment.impl.Wastebin
- All Implemented Interfaces:
ILocationObject
,IWastebin
,Cloneable
(Knowledge about) a waste bin.
-
Field Summary
Fields inherited from class jadex.quickstart.cleanerworld.environment.impl.LocationObject
pcs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a waste to this Wastebin.clone()
Clone the object.boolean
Test is the waste is in the waste bin.void
empty()
Empty the waste bin.void
fill()
Fill the waste bin.int
Get the capacity of this Wastebin.getWaste
(int idx) Get an wastes of this Wastebin.Waste[]
Get the wastes of this Wastebin.boolean
isFull()
Test is the wastebin is full.boolean
removeWaste
(Waste waste) Remove a waste from this Wastebin.void
setCapacity
(int capacity) Set the capacity of this Wastebin.void
Set a waste to this Wastebin.void
Set the wastes of this Wastebin.toString()
Get a string representation of this Wastebin.Methods inherited from class jadex.quickstart.cleanerworld.environment.impl.LocationObject
addPropertyChangeListener, equals, getId, getLocation, getPropertyChangeHandler, hashCode, removePropertyChangeListener, setId, setLocation, update
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface jadex.quickstart.cleanerworld.environment.IWastebin
getId, getLocation
-
Constructor Details
-
Wastebin
public Wastebin()Create a new Wastebin. -
Wastebin
Create a new wastebin.
-
-
Method Details
-
getWastes
Get the wastes of this Wastebin. -
setWastes
Set the wastes of this Wastebin.- Parameters:
wastes
- the value to be set
-
getWaste
Get an wastes of this Wastebin. -
setWaste
Set a waste to this Wastebin.- Parameters:
idx
- The index.waste
- a value to be added
-
addWaste
Add a waste to this Wastebin.- Parameters:
waste
- a value to be removed
-
removeWaste
Remove a waste from this Wastebin.- Parameters:
waste
- a value to be removed- Returns:
- True when the wastes have changed.
-
getCapacity
public int getCapacity()Get the capacity of this Wastebin.- Specified by:
getCapacity
in interfaceIWastebin
- Returns:
- The maximum number of waste objects to fit in this waste bin.
-
setCapacity
public void setCapacity(int capacity) Set the capacity of this Wastebin.- Parameters:
capacity
- the value to be set
-
toString
Get a string representation of this Wastebin. -
isFull
public boolean isFull()Test is the wastebin is full. -
empty
public void empty()Empty the waste bin. -
fill
public void fill()Fill the waste bin. -
contains
Test is the waste is in the waste bin. -
clone
Clone the object.- Overrides:
clone
in classLocationObject
-