Class AbstractRank

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractRank()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long count()
      Returns the number of ones in the bit vector indexed by this class.
      long rank​(long from, long to)
      Returns the number of ones in the specified interval.
      long rankZero​(long pos)
      Returns the number of zeroes preceding the specified position.
      long rankZero​(long from, long to)
      Returns the number of zeroes in the specified interval.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractRank

        public AbstractRank()
    • Method Detail

      • count

        public long count()
        Description copied from interface: Rank
        Returns the number of ones in the bit vector indexed by this class.
        Specified by:
        count in interface Rank
        Returns:
        number of ones in the bit vector indexed by this class.
      • rank

        public long rank​(long from,
                         long to)
        Description copied from interface: Rank
        Returns the number of ones in the specified interval.
        Specified by:
        rank in interface Rank
        Parameters:
        from - a position in the bit vector between 0 (inclusive) and the length of the bit vector (inclusive).
        to - a position in the bit vector between 0 (inclusive) and the length of the bit vector (inclusive); must be greater than or equal to from.
        Returns:
        the number of ones between from (inclusive) and to (exclusive); if the parameters are out of bounds, behavior is undefined.
      • rankZero

        public long rankZero​(long pos)
        Description copied from interface: Rank
        Returns the number of zeroes preceding the specified position.
        Specified by:
        rankZero in interface Rank
        Parameters:
        pos - a position in the bit vector between 0 (inclusive) and the length of the bit vector (inclusive).
        Returns:
        the number of zeroes preceding pos; if pos is out of bounds, behavior is undefined.
      • rankZero

        public long rankZero​(long from,
                             long to)
        Description copied from interface: Rank
        Returns the number of zeroes in the specified interval.
        Specified by:
        rankZero in interface Rank
        Parameters:
        from - a position in the bit vector between 0 (inclusive) and the length of the bit vector (inclusive).
        to - a position in the bit vector between 0 (inclusive) and the length of the bit vector (inclusive); must be greater than or equal to from.
        Returns:
        the number of zeros between from (inclusive) and to (exclusive); if the parameters are out of bounds, behavior is undefined (might throw an exception).