Interface Registry<C>

  • Type Parameters:
    C - anything that can be registered.
    All Known Subinterfaces:
    DefaultRegistry<C>
    All Known Implementing Classes:
    DefaultRegistryImpl

    public interface Registry<C>
    Represents a basic items registry.
    • Method Detail

      • register

        void register​(C item)
        Registers an item into the registry
        Parameters:
        item - An item to register
      • peek

        C peek()
        Peeks the last added item. Doesn't remove it.
        Returns:
        The last added item
      • pop

        C pop()
        Pops the last added item and removes it.
        Returns:
        The last added item
      • setMaxSize

        void setMaxSize​(int size)
        Sets the max number of items that can be stored on the registry.
        Parameters:
        size - A positive integer
      • clear

        void clear()
        Clears the registry
      • isEmpty

        boolean isEmpty()
        Determines if the registry is empty or not
        Returns:
        true if empty, false if not.
      • getHistory

        List<C> getHistory()
        Returns a List containing all the items in the registry
        Returns:
        A List of containing the registered items