Interface ScheduledEntries<K,V>
-
- All Known Implementing Classes:
LinkedScheduledEntries,SortedScheduledEntries
public interface ScheduledEntries<K,V> extends Iterable<Map.Entry<K,V>>
A collection of scheduled entries with a predictable iteration order.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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.default Iterator<Map.Entry<K,V>>iterator()default 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.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
isSorted
boolean isSorted()
Indicates whether the entries are sorted, or if iteration order recapitulates insertion order.- Returns:
- true, if these entries are sorted, false otherwise.
-
add
void add(K key, V value)
Adds an entry using the specified key and value.- Parameters:
key- an entry keyvalue- an entry value
-
remove
void remove(K key)
Removes the entry with the specified key.- Parameters:
key- an entry key
-
contains
boolean contains(K key)
Indicates whether specified key exists among the scheduled entries.- Parameters:
key- an entry key- Returns:
- true, if the key is a scheduled entry, false otherwise
-
stream
Stream<Map.Entry<K,V>> stream()
Returns a stream of scheduled entries.- Returns:
- a stream of scheduled entries.
-
-