Class Beacon.Memory

  • Enclosing class:
    Beacon

    public class Beacon.Memory
    extends java.lang.Object
    Memory of the beacon.
    • Constructor Summary

      Constructors 
      Constructor Description
      Memory​(int capacity)
      Create a new memory with the given capacity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int i)
      Add things to the memory.
      void clean()
      Clean the memory by remove everything on it.
      boolean isEmpty()
      Test if the memory is empty.
      boolean isFull()
      Test if the memory is full.
      int remove​(int i)
      Remove things to the memory.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Memory

        public Memory​(int capacity)
        Create a new memory with the given capacity.
        Parameters:
        capacity - Max capacity of the memory.
    • Method Detail

      • add

        public void add​(int i)
        Add things to the memory.
        Parameters:
        i - Size of the things to be added.
      • remove

        public int remove​(int i)
        Remove things to the memory.
        Parameters:
        i - Size of the things to remove.
        Returns:
        Size of removed resources.
      • clean

        public void clean()
        Clean the memory by remove everything on it.
      • isFull

        public boolean isFull()
        Test if the memory is full.
        Returns:
        true if the memory is full otherwise false.
      • isEmpty

        public boolean isEmpty()
        Test if the memory is empty.
        Returns:
        true if the memory is empty otherwise false.