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. Both#add(Object, Comparable)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.voidforEach(Consumer<? super Map.Entry<K,V>> action)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.Spliterator<Map.Entry<K,V>>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
-
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>
-
spliterator
public Spliterator<Map.Entry<K,V>> spliterator()
- Specified by:
spliteratorin interfaceIterable<K>
-
-