Interface Frontier<E>

  • Type Parameters:
    E -
    All Known Implementing Classes:
    FIFOFrontier, LIFOFrontier, LRUFrontier

    public interface Frontier<E>
    Data structure for maintaining the worklist set of elements to process in a prescribed order.
    Author:
    Ben Holland
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean add​(E e)
      Adds the element to the frontier Returns true if the element was added, false if the element already existed.
      boolean hasNext()
      Returns true if the frontier is not empty, false otherwise
      E next()
      Returns (and removes) the next element from the frontier
      long size()
      Returns the number of elements on the frontier
      java.lang.String toString()
      Returns a string representation of this frontier collection.
    • Method Detail

      • hasNext

        boolean hasNext()
        Returns true if the frontier is not empty, false otherwise
        Returns:
      • next

        E next()
        Returns (and removes) the next element from the frontier
        Returns:
      • add

        boolean add​(E e)
        Adds the element to the frontier Returns true if the element was added, false if the element already existed.
        Parameters:
        e -
        Returns:
      • toString

        java.lang.String toString()
        Returns a string representation of this frontier collection.
        Overrides:
        toString in class java.lang.Object
        Returns:
      • size

        long size()
        Returns the number of elements on the frontier
        Returns: