Class LinkedScheduledEntries<K,V>
- java.lang.Object
-
- org.wildfly.clustering.ee.cache.scheduler.LinkedScheduledEntries<K,V>
-
- All Implemented Interfaces:
Iterable<Map.Entry<K,V>>,ScheduledEntries<K,V>
public class LinkedScheduledEntries<K,V> extends Object implements ScheduledEntries<K,V>
ScheduledEntriesimplemented using aConcurrentDirectDeque. Bothadd(Object, Object)andremove(Object)run in O(1) time.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description LinkedScheduledEntries()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(K key, V value)Adds an entry using the specified key and value.booleancontains(K key)Indicates whether specified key exists among the scheduled entries.booleanisSorted()Indicates whether the entries are sorted, or if iteration order recapitulates insertion order.Iterator<Map.Entry<K,V>>iterator()Map.Entry<K,V>peek()Returns, but does not remove, the first entry.voidremove(K key)Removes the entry with the specified key.Stream<Map.Entry<K,V>>stream()Returns a stream of scheduled entries.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
isSorted
public boolean isSorted()
Description copied from interface:ScheduledEntriesIndicates whether the entries are sorted, or if iteration order recapitulates insertion order.- Specified by:
isSortedin interfaceScheduledEntries<K,V>- Returns:
- true, if these entries are sorted, false otherwise.
-
add
public void add(K key, V value)
Description copied from interface:ScheduledEntriesAdds an entry using the specified key and value.- Specified by:
addin interfaceScheduledEntries<K,V>- Parameters:
key- an entry keyvalue- an entry value
-
remove
public void remove(K key)
Description copied from interface:ScheduledEntriesRemoves the entry with the specified key.- Specified by:
removein interfaceScheduledEntries<K,V>- Parameters:
key- an entry key
-
contains
public boolean contains(K key)
Description copied from interface:ScheduledEntriesIndicates whether specified key exists among the scheduled entries.- Specified by:
containsin interfaceScheduledEntries<K,V>- Parameters:
key- an entry key- Returns:
- true, if the key is a scheduled entry, false otherwise
-
peek
public Map.Entry<K,V> peek()
Description copied from interface:ScheduledEntriesReturns, but does not remove, the first entry.- Specified by:
peekin interfaceScheduledEntries<K,V>
-
stream
public Stream<Map.Entry<K,V>> stream()
Description copied from interface:ScheduledEntriesReturns a stream of scheduled entries.- Specified by:
streamin interfaceScheduledEntries<K,V>- Returns:
- a stream of scheduled entries.
-
-