Class LRUFrontier<E>
- java.lang.Object
-
- com.ensoftcorp.open.pointsto.utilities.frontier.LRUFrontier<E>
-
-
Constructor Summary
Constructors Constructor Description LRUFrontier()
Creates a new frontierLRUFrontier(int initialCapacity)
Creates a new frontier with the given initial capacity
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
Adds the element to the frontier, moving the element to the end of the frontier if it already is contained in the frontier.boolean
hasNext()
Returns true if the frontier is not empty, false otherwiseE
next()
Returns (and removes) the next element from the frontier in Least Recently Used (LRU) orderlong
size()
Returns the number of elements in this frontier set (its cardinality).java.lang.String
toString()
Returns a string representation of this frontier collection.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returns true if the frontier is not empty, false otherwise
-
next
public E next()
Returns (and removes) the next element from the frontier in Least Recently Used (LRU) order
-
add
public boolean add(E e)
Adds the element to the frontier, moving the element to the end of the frontier if it already is contained in the frontier. Returns true if the element was added, false if the element already existed.
-
size
public long size()
Returns the number of elements in this frontier set (its cardinality).
-
toString
public java.lang.String toString()
Returns a string representation of this frontier collection. The string representation consists of a list of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings as by String.valueOf(Object).
-
-