Class ChunkedHashStore.Chunk

  • All Implemented Interfaces:
    java.lang.Iterable<long[]>
    Enclosing class:
    ChunkedHashStore<T>

    public static final class ChunkedHashStore.Chunk
    extends java.lang.Object
    implements java.lang.Iterable<long[]>
    A chunk returned by a ChunkedHashStore.
    • Constructor Summary

      Constructors 
      Constructor Description
      Chunk()
      Creates a chunk with all field set to zero or null.
      Chunk​(ChunkedHashStore.Chunk chunk)
      Copy constructor for multi-threaded chunk analysis.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long data​(long k)
      Returns the data of the k-th triple returned by this chunk.
      int index()
      The index of this chunk.
      java.util.Iterator<long[]> iterator()
      Returns an iterator over the quadruples associated with this chunk; the returned array of longs is reused at each call.
      int size()
      The number of triples in this chunk.
      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 chunk, or the data obtained by using the chunk 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 Detail

      • Chunk

        public Chunk​(ChunkedHashStore.Chunk chunk)
        Copy constructor for multi-threaded chunk analysis.
        Parameters:
        chunk - a chunk to be copied.
      • Chunk

        public Chunk()
        Creates a chunk with all field set to zero or null. Mainly useful to create marker objects.
    • Method Detail

      • size

        public int size()
        The number of triples in this chunk.
        Returns:
        the number of triples in this chunk.
      • index

        public int index()
        The index of this chunk.
        Returns:
        the index of this chunk.
      • data

        public long data​(long k)
        Returns the data of the k-th triple returned by this chunk.

        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 triple.
        Returns:
        the corresponding data.
      • iterator

        public java.util.Iterator<long[]> iterator()
        Returns an iterator over the quadruples associated with this chunk; the returned array of longs is reused at each call.
        Specified by:
        iterator in interface java.lang.Iterable<long[]>
        Returns:
        an iterator over quadruples formed by a triple (indices 0, 1, 2) and the associated data (index 3).
      • 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 chunk, or the data obtained by using the chunk 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 chunk is used to index this list and return a value. Otherwise, the data in the chunk is returned directly.
        Returns:
        a big list of longs representing the values associated with each element in the chunk.