java.lang.Object
jadex.quickstart.cleanerworld.environment.impl.LocationObject
jadex.quickstart.cleanerworld.environment.impl.Wastebin
All Implemented Interfaces:
ILocationObject, IWastebin, Cloneable

public class Wastebin extends LocationObject implements IWastebin
(Knowledge about) a waste bin.
  • Constructor Details

    • Wastebin

      public Wastebin()
      Create a new Wastebin.
    • Wastebin

      public Wastebin(Location location, int capacity)
      Create a new wastebin.
  • Method Details

    • getWastes

      public Waste[] getWastes()
      Get the wastes of this Wastebin.
      Specified by:
      getWastes in interface IWastebin
      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.
      Specified by:
      getWaste in interface IWastebin
      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(IWaste 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.
      Specified by:
      getCapacity in interface IWastebin
      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

      public String toString()
      Get a string representation of this Wastebin.
      Overrides:
      toString in class Object
      Returns:
      The string representation.
    • isFull

      public boolean isFull()
      Test is the wastebin is full.
      Specified by:
      isFull in interface IWastebin
      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(IWaste waste)
      Test is the waste is in the waste bin.
      Specified by:
      contains in interface IWastebin
      Returns:
      True, when wastebin contains the waste.
    • clone

      public Wastebin clone()
      Clone the object.
      Overrides:
      clone in class LocationObject