Package org.hcjf.utils
Class TtlSet<V>
- java.lang.Object
-
- org.hcjf.utils.TtlCollection<V>
-
- org.hcjf.utils.TtlSet<V>
-
- All Implemented Interfaces:
java.lang.Iterable<V>,java.util.Collection<V>,java.util.Set<V>
public class TtlSet<V> extends TtlCollection<V> implements java.util.Set<V>
- Author:
- javaito
-
-
Method Summary
Modifier and Type Method Description booleanadd(V v)booleanaddAll(java.util.Collection<? extends V> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)inthashCode()booleanisEmpty()java.util.Iterator<V>iterator()java.util.stream.Stream<V>parallelStream()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanremoveIf(java.util.function.Predicate<? super V> filter)protected voidremoveOldInstance(V instanceKey)This implementation remove the specific instance of the wrapped collection.booleanretainAll(java.util.Collection<?> c)intsize()java.util.Spliterator<V>spliterator()java.util.stream.Stream<V>stream()java.lang.Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class org.hcjf.utils.TtlCollection
addInstance, removeOldWindows
-
-
-
-
Constructor Detail
-
TtlSet
public TtlSet(java.util.Set<V> instance, java.lang.Long timeWindowsSize)
-
-
Method Detail
-
removeOldInstance
protected void removeOldInstance(V instanceKey)
Description copied from class:TtlCollectionThis implementation remove the specific instance of the wrapped collection.- Specified by:
removeOldInstancein classTtlCollection<V>- Parameters:
instanceKey- Instance key.
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<V> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(V v)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends V> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
clear
public void clear()
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
spliterator
public java.util.Spliterator<V> spliterator()
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super V> filter)
- Specified by:
removeIfin interfacejava.util.Collection<V>
-
stream
public java.util.stream.Stream<V> stream()
- Specified by:
streamin interfacejava.util.Collection<V>
-
-