E - the element typepublic interface Bucket<E> extends Set<E>
Set, which allows contained elements
to be separated into parts by a PartitioningStrategy.
The performance of Bucket should be largely similar to the performance
of the underlying Set. Elements are stored twice - once in a set
containing all elements in the bucket, and again in a set representing each partition.
| Modifier and Type | Method and Description |
|---|---|
Cycle<BucketPartition<E>> |
asCycle()
Returns a cycle instance unique to this bucket.
|
BucketPartition<E> |
getPartition(int i)
Gets the partition with the given index value
|
int |
getPartitionCount()
Gets the number of partitions used to form this bucket.
|
List<BucketPartition<E>> |
getPartitions()
Gets the partitions which form this bucket.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamint getPartitionCount()
@Nonnull BucketPartition<E> getPartition(int i)
i - the partition indexIndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= getPartitionCount())@Nonnull List<BucketPartition<E>> getPartitions()
@Nonnull Cycle<BucketPartition<E>> asCycle()
This method is provided as a utility for operating deterministically on all elements within the bucket over a period of time.
The same cycle instance is returned for each bucket.
Copyright © 2020. All rights reserved.