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 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.
See Also:
  • Method Details

    • forEachUnordered

      void forEachUnordered(@Nonnull Consumer<? super T> action)
      Behavior similar to Iterable.forEach(Consumer) but does not preserve order.
      This will not copy the data store as sorting is not needed.
      Specified by:
      forEachUnordered in interface CacheView<T extends Comparable<? super T> & ISnowflake>
      Parameters:
      action - The action to perform
      Throws:
      NullPointerException - If provided with null
      Since:
      4.0.0
    • asSet

      @Nonnull NavigableSet<T> asSet()
      Description copied from interface: CacheView
      Creates an immutable snapshot of the current cache state.
      This will copy all elements contained in this cache into a set.
      Specified by:
      asSet in interface CacheView<T extends Comparable<? super T> & ISnowflake>
      Returns:
      Immutable set of cached elements
    • streamUnordered

      @Nonnull Stream<T> streamUnordered()
      Behavior similar to CacheView.stream() which does not preserve order.
      Returns:
      Stream of the contained elements
      Since:
      4.0.0
    • parallelStreamUnordered

      @Nonnull Stream<T> parallelStreamUnordered()
      Behavior similar to CacheView.parallelStream() which does not preserve order.
      Returns:
      (Parallel) Stream of contained elements
      Since:
      4.0.0