Package net.dv8tion.jda.api.utils.cache
Interface SortedSnowflakeCacheView<T extends Comparable<? super T> & ISnowflake>
- Type Parameters:
- T- The entity type
- All Superinterfaces:
- CacheView<T>,- Iterable<T>,- SnowflakeCacheView<T>
- All Known Subinterfaces:
- SortedChannelCacheView<T>
public interface SortedSnowflakeCacheView<T extends Comparable<? super T> & ISnowflake>
extends SnowflakeCacheView<T>
Specialized 
In this specialization
CacheView for entities that occur in a specified order.
 In this specialization
Iterable.forEach(Consumer) will copy the underlying data store
 in order to preserve order on iterations, use forEachUnordered(Consumer) to avoid this overhead.- 
Nested Class SummaryNested classes/interfaces inherited from interface net.dv8tion.jda.api.utils.cache.CacheViewCacheView.SimpleCacheView<T>
- 
Method SummaryModifier and TypeMethodDescriptionasSet()Creates an immutable snapshot of the current cache state.voidforEachUnordered(Consumer<? super T> action) Behavior similar toIterable.forEach(Consumer)but does not preserve order.Behavior similar toCacheView.parallelStream()which does not preserve order.Behavior similar toCacheView.stream()which does not preserve order.Methods inherited from interface net.dv8tion.jda.api.utils.cache.CacheViewacceptStream, applyStream, asList, collect, getElementsByName, getElementsByName, isEmpty, lockedIterator, parallelStream, size, streamMethods inherited from interface java.lang.IterableforEach, iterator, spliteratorMethods inherited from interface net.dv8tion.jda.api.utils.cache.SnowflakeCacheViewgetElementById, getElementById
- 
Method Details- 
forEachUnorderedBehavior similar toIterable.forEach(Consumer)but does not preserve order.
 This will not copy the data store as sorting is not needed.- Specified by:
- forEachUnorderedin interface- CacheView<T extends Comparable<? super T> & ISnowflake>
- Parameters:
- action- The action to perform
- Throws:
- NullPointerException- If provided with null
- Since:
- 4.0.0
 
- 
asSetDescription copied from interface:CacheViewCreates an immutable snapshot of the current cache state.
 This will copy all elements contained in this cache into a set.- Specified by:
- asSetin interface- CacheView<T extends Comparable<? super T> & ISnowflake>
- Returns:
- Immutable set of cached elements
 
- 
streamUnorderedBehavior similar toCacheView.stream()which does not preserve order.- Returns:
- Stream of the contained elements
- Since:
- 4.0.0
 
- 
parallelStreamUnorderedBehavior similar toCacheView.parallelStream()which does not preserve order.- Returns:
- (Parallel) Stream of contained elements
- Since:
- 4.0.0
 
 
-