Class GHBitSetImpl

java.lang.Object
java.util.BitSet
com.graphhopper.coll.GHBitSetImpl
All Implemented Interfaces:
GHBitSet, Serializable, Cloneable

public class GHBitSetImpl extends BitSet implements GHBitSet
This implementation stores the bits inside the values of a long-array. Be aware that the size of this array grows depending on the values you pass into this set. If you only want to add a few (possibly large) integers you should use GHTBitSet instead.
Author:
Peter Karich
See Also:
  • Constructor Details

    • GHBitSetImpl

      public GHBitSetImpl()
    • GHBitSetImpl

      public GHBitSetImpl(int nbits)
  • 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
    • getCardinality

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

      public final 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
    • nextClear

      public final int nextClear(int index)
    • 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