it.unimi.dsi.sux4j.io
Class ChunkedHashStore.Chunk

java.lang.Object
  extended by it.unimi.dsi.sux4j.io.ChunkedHashStore.Chunk
All Implemented Interfaces:
Iterable<long[]>
Enclosing class:
ChunkedHashStore<T>

public static final class ChunkedHashStore.Chunk
extends Object
implements Iterable<long[]>

A chunk returned by a ChunkedHashStore.


Method Summary
 Iterator<long[]> iterator()
          Returns an iterator over the triples associated to this chunk; the returned array of longs is reused at each call.
 int offset(int k)
          Returns the offset of the k-th triple returned by this chunk.
 int size()
          The number of triples in this chunk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public int size()
The number of triples in this chunk.

Returns:
the number of triples in this chunk.

offset

public int offset(int k)
Returns the offset of the k-th triple returned by this chunk.

This method provides an alternative random access to offset 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 offset.

iterator

public Iterator<long[]> iterator()
Returns an iterator over the triples associated to this chunk; the returned array of longs is reused at each call.

Specified by:
iterator in interface Iterable<long[]>
Returns:
an iterator over quadruples formed by a triple (indices 0, 1, 2) and the associated offset (index 3).