Class GHTBitSet

java.lang.Object
com.graphhopper.coll.GHTBitSet
All Implemented Interfaces:
GHBitSet

public class GHTBitSet extends Object implements GHBitSet
Implements the bitset interface via a hash set. It is more efficient for only a few entries.

Author:
Peter Karich
  • Constructor Details

    • GHTBitSet

      public GHTBitSet(GHIntHashSet set)
    • GHTBitSet

      public GHTBitSet(int no)
    • GHTBitSet

      public GHTBitSet()
  • Method Details

    • contains

      public final boolean contains(int index)
      Specified by:
      contains in interface GHBitSet
    • add

      public final void add(int index)
      Specified by:
      add in interface GHBitSet
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • getCardinality

      public final int getCardinality()
      Specified by:
      getCardinality in interface GHBitSet
    • clear

      public final void clear()
      Specified by:
      clear in interface GHBitSet
    • remove

      public void remove(int index)
      Specified by:
      remove in interface GHBitSet
    • copyTo

      public final GHBitSet copyTo(GHBitSet bs)
      Specified by:
      copyTo in interface GHBitSet
      Returns:
      the specified MyBitSet bs
    • next

      public int next(int index)
      Description copied from interface: GHBitSet
      Searches for a greater or equal entry and returns it.

      Specified by:
      next in interface GHBitSet
      Returns:
      -1 if nothing found