Class Wastebin
- java.lang.Object
-
- jadex.bdi.examples.cleanerworld_classic.LocationObject
-
- jadex.bdi.examples.cleanerworld_classic.Wastebin
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Wastebin extends LocationObject
Editable Java class for concept Wastebin of cleaner-generated ontology.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
capacity
Attribute for slot capacity.protected static int
instancecnt
The instance counter.protected java.lang.String
name
Attribute for slot name.protected java.util.List
wastes
Attribute for slot wastes.-
Fields inherited from class jadex.bdi.examples.cleanerworld_classic.LocationObject
id, location, pcs
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWaste(Waste waste)
Add a waste to this Wastebin.java.lang.Object
clone()
Clone the object.boolean
contains(Waste waste)
Test is the waste is in the waste bin.void
empty()
Empty the waste bin.void
fill()
Fill the waste bin.int
getCapacity()
Get the capacity of this Wastebin.java.lang.String
getName()
Get the name of this Wastebin.Waste
getWaste(int idx)
Get an wastes of this Wastebin.Waste[]
getWastes()
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
setName(java.lang.String name)
Set the name of this Wastebin.void
setWaste(int idx, Waste waste)
Set a waste to this Wastebin.void
setWastes(Waste[] wastes)
Set the wastes of this Wastebin.java.lang.String
toString()
Get a string representation of this Wastebin.void
update(Wastebin wb)
Update this wastebin.-
Methods inherited from class jadex.bdi.examples.cleanerworld_classic.LocationObject
addPropertyChangeListener, equals, getId, getLocation, hashCode, removePropertyChangeListener, setId, setLocation
-
-
-
-
Method Detail
-
getWastes
public Waste[] getWastes()
Get the wastes of this Wastebin.- Returns:
- wastes
-
setWastes
public void setWastes(Waste[] wastes)
Set the wastes of this Wastebin.- Parameters:
wastes
- the value to be set
-
getWaste
public Waste getWaste(int idx)
Get an wastes of this Wastebin.- Parameters:
idx
- The index.- Returns:
- wastes
-
setWaste
public void setWaste(int idx, Waste waste)
Set a waste to this Wastebin.- Parameters:
idx
- The index.waste
- a value to be added
-
addWaste
public void addWaste(Waste waste)
Add a waste to this Wastebin.- Parameters:
waste
- a value to be removed
-
removeWaste
public boolean removeWaste(Waste waste)
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.- Returns:
- capacity
-
setCapacity
public void setCapacity(int capacity)
Set the capacity of this Wastebin.- Parameters:
capacity
- the value to be set
-
getName
public java.lang.String getName()
Get the name of this Wastebin.- Returns:
- name
-
setName
public void setName(java.lang.String name)
Set the name of this Wastebin.- Parameters:
name
- the value to be set
-
toString
public java.lang.String toString()
Get a string representation of this Wastebin.- Overrides:
toString
in classLocationObject
- Returns:
- The string representation.
-
isFull
public boolean isFull()
Test is the wastebin is full.- Returns:
- True, when wastebin is full.
-
empty
public void empty()
Empty the waste bin.
-
fill
public void fill()
Fill the waste bin.
-
contains
public boolean contains(Waste waste)
Test is the waste is in the waste bin.- Returns:
- True, when wastebin contains the waste.
-
clone
public java.lang.Object clone()
Clone the object.- Overrides:
clone
in classLocationObject
-
update
public void update(Wastebin wb)
Update this wastebin.
-
-