Package com.glitchybyte.glib.cache
Class GExpiringCacheList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.AbstractSequentialList<T>
com.glitchybyte.glib.cache.GExpiringCacheList<T>
- Type Parameters:
T- Type of item.
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>,SequencedCollection<T>
List with expiring items.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionGExpiringCacheList(long amount, TemporalUnit unit) Creates a cache with the given time-to-live.GExpiringCacheList(TemporalAmount timeToLive) Creates a cache with the given time-to-live. -
Method Summary
Methods inherited from class java.util.AbstractSequentialList
add, addAll, get, iterator, remove, setMethods inherited from class java.util.AbstractList
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Constructor Details
-
GExpiringCacheList
Creates a cache with the given time-to-live.- Parameters:
timeToLive- Time to live for a given item.
-
GExpiringCacheList
Creates a cache with the given time-to-live.- Parameters:
amount- The amount of TTL duration.unit- The unit TLL is measured in.
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>- Specified by:
listIteratorin classAbstractSequentialList<T>
-