Class BucketedHashStore.Bucket
java.lang.Object
it.unimi.dsi.sux4j.io.BucketedHashStore.Bucket
- All Implemented Interfaces:
Iterable<long[]>
- Enclosing class:
BucketedHashStore<T>
A bucket returned by a
BucketedHashStore.- Since:
- 5.0.0
- Author:
- Sebastiano Vigna
-
Constructor Summary
ConstructorsConstructorDescriptionBucket()Creates a bucket with all field set to zero or null.Bucket(BucketedHashStore.Bucket bucket) Copy constructor for multi-threaded bucket analysis. -
Method Summary
Modifier and TypeMethodDescriptionlongdata(long k) Returns the data of thek-th signature returned by this bucket.longindex()The index of this bucket.Iterator<long[]> iterator()Returns an iterator over the triples associated with this bucket; the returned array of longs is reused at each call.intsize()The number of signatures in this bucket.it.unimi.dsi.fastutil.longs.LongBigListvalueList(it.unimi.dsi.fastutil.longs.LongIterable values) Commodity methods that exposes transparently either the data contained in the bucket, or the data obtained by using the bucket to index a list.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
Bucket
Copy constructor for multi-threaded bucket analysis.- Parameters:
bucket- a bucket to be copied.
-
Bucket
public Bucket()Creates a bucket with all field set to zero or null. Mainly useful to create marker objects.
-
-
Method Details
-
size
public int size()The number of signatures in this bucket.- Returns:
- the number of signatures in this bucket.
-
index
public long index()The index of this bucket.- Returns:
- the index of this bucket.
-
data
public long data(long k) Returns the data of thek-th signature returned by this bucket.This method provides an alternative random access to data (w.r.t. indexing the fourth element of the quadruples returned by
iterator()).- Parameters:
k- the index (in iteration order) of a signature.- Returns:
- the corresponding data.
-
iterator
Returns an iterator over the triples associated with this bucket; the returned array of longs is reused at each call. -
valueList
public it.unimi.dsi.fastutil.longs.LongBigList valueList(it.unimi.dsi.fastutil.longs.LongIterable values) Commodity methods that exposes transparently either the data contained in the bucket, or the data obtained by using the bucket to index a list.- Parameters:
values- a list of values. Must be either an instance ofLongList, or an instance ofLongBigList. If it is notnull, the data in the bucket is used to index this list and return a value. Otherwise, the data in the bucket is returned directly.- Returns:
- a big list of longs representing the values associated with each element in the bucket.
-