Package ghidra.util.datastruct
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:
java.lang.Iterable<T>
,java.util.Map<T,T>
public class LRUSet<T> extends LRUMap<T,T> implements java.lang.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 Summary
Constructors Constructor Description LRUSet(int size)
Constructs this set with the given size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T t)
java.util.Iterator<T>
iterator()
java.lang.String
toString()
-
Methods inherited from class ghidra.util.datastruct.LRUMap
clear, containsKey, containsValue, eldestEntryRemoved, entrySet, get, isEmpty, keySet, put, putAll, remove, removeEldestEntry, size, values
-
-
-
-
Constructor Detail
-
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.
-
-