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>
ScheduledEntries implemented using a ConcurrentDirectDeque. Both add(Object, Object) and remove(Object) run in O(1) time.
Author:
Paul Ferraro
  • Constructor Details

    • LinkedScheduledEntries

      public LinkedScheduledEntries()
  • Method Details

    • isSorted

      public boolean isSorted()
      Description copied from interface: ScheduledEntries
      Indicates whether the entries are sorted, or if iteration order recapitulates insertion order.
      Specified by:
      isSorted in interface ScheduledEntries<K,V>
      Returns:
      true, if these entries are sorted, false otherwise.
    • add

      public void add(K key, V value)
      Description copied from interface: ScheduledEntries
      Adds an entry using the specified key and value.
      Specified by:
      add in interface ScheduledEntries<K,V>
      Parameters:
      key - an entry key
      value - an entry value
    • remove

      public void remove(K key)
      Description copied from interface: ScheduledEntries
      Removes the entry with the specified key.
      Specified by:
      remove in interface ScheduledEntries<K,V>
      Parameters:
      key - an entry key
    • contains

      public boolean contains(K key)
      Description copied from interface: ScheduledEntries
      Indicates whether specified key exists among the scheduled entries.
      Specified by:
      contains in interface ScheduledEntries<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: ScheduledEntries
      Returns, but does not remove, the first entry.
      Specified by:
      peek in interface ScheduledEntries<K,V>
    • stream

      public Stream<Map.Entry<K,V>> stream()
      Description copied from interface: ScheduledEntries
      Returns a stream of scheduled entries.
      Specified by:
      stream in interface ScheduledEntries<K,V>
      Returns:
      a stream of scheduled entries.
    • iterator

      public Iterator<Map.Entry<K,V>> iterator()
      Specified by:
      iterator in interface Iterable<K>
      Specified by:
      iterator in interface ScheduledEntries<K,V>
    • toString

      public String toString()
      Overrides:
      toString in class Object