Class LRUSet<T>

java.lang.Object
ghidra.util.datastruct.LRUMap<T,T>
ghidra.util.datastruct.LRUSet<T>
Type Parameters:
T - the type of items in the set
All Implemented Interfaces:
Iterable<T>, Map<T,T>

public class LRUSet<T> extends LRUMap<T,T> implements Iterable<T>
An ordered set-like data structure.

Use this when you need a collection of unique items (hence set) that are also ordered by insertion time.

  • Constructor Details

    • LRUSet

      public LRUSet(int size)
      Constructs this set with the given size. As elements are added, the oldest elements (by access time) will fall off the bottom of the set.

      If you do not wish to have a set bounded by size, then you can override LRUMap.removeEldestEntry(java.util.Map.Entry) to do nothing.

      Parameters:
      size - The size to which this set will be restricted.
  • Method Details