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 TypeMethodDescriptionvoidAdd a waste to this Wastebin.clone()Clone the object.booleanTest is the waste is in the waste bin.voidempty()Empty the waste bin.voidfill()Fill the waste bin.intGet the capacity of this Wastebin.getWaste(int idx) Get an wastes of this Wastebin.Waste[]Get the wastes of this Wastebin.booleanisFull()Test is the wastebin is full.booleanremoveWaste(Waste waste) Remove a waste from this Wastebin.voidsetCapacity(int capacity) Set the capacity of this Wastebin.voidSet a waste to this Wastebin.voidSet 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, updateMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
getCapacityin 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:
clonein classLocationObject
-