Class BucketedHashStore.Bucket

java.lang.Object
it.unimi.dsi.sux4j.io.BucketedHashStore.Bucket
All Implemented Interfaces:
Iterable<long[]>
Enclosing class:
BucketedHashStore<T>

public static final class BucketedHashStore.Bucket extends Object implements Iterable<long[]>
A bucket returned by a BucketedHashStore.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a bucket with all field set to zero or null.
    Copy constructor for multi-threaded bucket analysis.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    data(long k)
    Returns the data of the k-th signature returned by this bucket.
    long
    The index of this bucket.
    Iterator<long[]>
    Returns an iterator over the triples associated with this bucket; the returned array of longs is reused at each call.
    int
    The number of signatures in this bucket.
    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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • Bucket

      public Bucket(BucketedHashStore.Bucket 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 the k-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

      public Iterator<long[]> iterator()
      Returns an iterator over the triples associated with this bucket; the returned array of longs is reused at each call.
      Specified by:
      iterator in interface Iterable<long[]>
      Returns:
      an iterator over triples formed by a signature (indices 0, 1) and the associated data (index 2).
    • valueList

      public LongBigList valueList(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 of LongList, or an instance of LongBigList. If it is not null, 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.