Class Allocation


  • public class Allocation
    extends java.lang.Object
    • Constructor Detail

      • Allocation

        protected Allocation​(Entity entity,
                             Resource resource)
    • Method Detail

      • nullify

        public final void nullify()
      • setEntity

        protected final void setEntity​(Entity entity)
      • setAllocatedResource

        protected final void setAllocatedResource​(Resource resource)
      • increaseAllocation

        protected final void increaseAllocation​(int amountAllocated)
      • decreaseAllocation

        protected final void decreaseAllocation​(int amountOfDecrease)
      • getAmountAllocated

        public final int getAmountAllocated()
        The current amount allocated
        Returns:
      • isAllocated

        public final boolean isAllocated()
        Returns true if there are units allocated
        Returns:
      • isDeallocated

        public final boolean isDeallocated()
        Returns true if there are no units allocated
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getEntity

        public final Entity getEntity()
        The Entity associated with the allocation
        Returns:
      • getAllocatedResource

        public final Resource getAllocatedResource()
        Gets the resource that is associated with the allocation
        Returns:
        The resource