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 intcapacityAttribute for slot capacity.protected static intinstancecntThe instance counter.protected java.lang.StringnameAttribute for slot name.protected java.util.ListwastesAttribute 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 voidaddWaste(Waste waste)Add a waste to this Wastebin.java.lang.Objectclone()Clone the object.booleancontains(Waste waste)Test is the waste is in the waste bin.voidempty()Empty the waste bin.voidfill()Fill the waste bin.intgetCapacity()Get the capacity of this Wastebin.java.lang.StringgetName()Get the name of this Wastebin.WastegetWaste(int idx)Get an wastes of this Wastebin.Waste[]getWastes()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.voidsetName(java.lang.String name)Set the name of this Wastebin.voidsetWaste(int idx, Waste waste)Set a waste to this Wastebin.voidsetWastes(Waste[] wastes)Set the wastes of this Wastebin.java.lang.StringtoString()Get a string representation of this Wastebin.voidupdate(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:
toStringin 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:
clonein classLocationObject
-
update
public void update(Wastebin wb)
Update this wastebin.
-
-