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 booleanadd(E e)Adds the element to the frontier Returns true if the element was added, false if the element already existed.booleanhasNext()Returns true if the frontier is not empty, false otherwiseEnext()Returns (and removes) the next element from the frontierlongsize()Returns the number of elements on the frontierjava.lang.StringtoString()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:
toStringin classjava.lang.Object- Returns:
-
size
long size()
Returns the number of elements on the frontier- Returns:
-
-