Class FastHashedTripleBunch

All Implemented Interfaces:
Iterable<Triple>, org.apache.jena.atlas.lib.Copyable<FastTripleBunch>, JenaMapSetCommon<Triple>, JenaSet<Triple>, JenaSetHashOptimized<Triple>, JenaSetIndexed<Triple>, Sized, FastTripleBunch

public class FastHashedTripleBunch extends FastHashSet<Triple> implements FastTripleBunch
Hashed implementation of FastTripleBunch built on top of FastHashSet. Used by FastTripleStore once a bunch grows past the size threshold at which a linear-scan FastArrayBunch stops being faster.
  • Constructor Details

    • FastHashedTripleBunch

      public FastHashedTripleBunch(JenaSet<Triple> set)
      Create a new hashed bunch pre-populated from the given set of triples. The initial capacity is chosen at 1.5x the source size, so the new bunch fits the existing triples and has some headroom for growth before it needs to rehash.
      Parameters:
      set - the source set of triples (typically the array bunch being promoted)
    • FastHashedTripleBunch

      public FastHashedTripleBunch()
      Creates an empty hashed bunch with the default initial capacity.
  • Method Details

    • isArray

      public boolean isArray()
      Description copied from interface: FastTripleBunch
      Answer true iff this bunch is backed by a flat array (i.e. is a FastArrayBunch). Exposed as an explicit method so callers can avoid instanceof checks on this hot path.
      Specified by:
      isArray in interface FastTripleBunch
      Returns:
      true if this bunch is array-backed
    • copy

      public FastHashedTripleBunch copy()
      Specified by:
      copy in interface org.apache.jena.atlas.lib.Copyable<FastTripleBunch>