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>
ScheduledEntries implemented using a ConcurrentDirectDeque.
Both add(Object, Object) and remove(Object) run in O(1) time.- Author:
- Paul Ferraro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an entry using the specified key and value.booleanIndicates whether specified key exists among the scheduled entries.booleanisSorted()Indicates whether the entries are sorted, or if iteration order recapitulates insertion order.iterator()peek()Returns, but does not remove, the first entry.voidRemoves the entry with the specified key.stream()Returns a stream of scheduled entries.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
LinkedScheduledEntries
public LinkedScheduledEntries()
-
-
Method Details
-
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
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
Description copied from interface:ScheduledEntriesRemoves the entry with the specified key.- Specified by:
removein interfaceScheduledEntries<K,V> - Parameters:
key- an entry key
-
contains
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
Description copied from interface:ScheduledEntriesReturns, but does not remove, the first entry.- Specified by:
peekin interfaceScheduledEntries<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.
-
iterator
-
toString
-