Documentation of 'org.apache.derby.iapi.util.JBitSet' Java class
JBitSet
org.apache.derby.iapi.util

Class JBitSet



  • public final class JBitSet
    extends java.lang.Object
    JBitSet is a wrapper class for BitSet. It is a fixed length implementation which can be extended via the grow() method. It provides additional methods to manipulate BitSets. NOTE: JBitSet was driven by the (current and perceived) needs of the optimizer, but placed in the util package since it is not specific to query trees.. NOTE: java.util.BitSet is final, so we must provide a wrapper class which includes a BitSet member in order to extend the functionality. We want to make it look like JBitSet extends BitSet, so we need to provide wrapper methods for all of BitSet's methods.
    • Constructor Summary

      Constructors 
      Constructor and Description
      JBitSet(int size)
      Construct a JBitSet of the specified size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void and(JBitSet set) 
      void clear(int bitIndex) 
      void clearAll()
      Clear all of the bits in this JBitSet
      java.lang.Object clone() 
      boolean contains(JBitSet jBitSet)
      Test to see if one JBitSet contains another one of the same size.
      boolean equals(java.lang.Object obj) 
      boolean get(int bitIndex) 
      int getFirstSetBit()
      Get the first set bit (starting at index 0) from a JBitSet.
      void grow(int newSize)
      Grow an existing JBitSet to the specified size.
      int hashCode() 
      boolean hasSingleBitSet()
      See of a JBitSet has exactly 1 bit set.
      void or(JBitSet set) 
      void set(int bitIndex) 
      void setTo(JBitSet sourceBitSet)
      Set the BitSet to have the exact same bits set as the parameter's BitSet.
      int size()
      Return the size of bitSet
      java.lang.String toString() 
      void xor(JBitSet set) 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JBitSet

        public JBitSet(int size)
        Construct a JBitSet of the specified size.
        Parameters:
        size - The number of bits in the JBitSet.
    • Method Detail

      • setTo

        public void setTo(JBitSet sourceBitSet)
        Set the BitSet to have the exact same bits set as the parameter's BitSet.
        Parameters:
        sourceBitSet - The JBitSet to copy.
      • contains

        public boolean contains(JBitSet jBitSet)
        Test to see if one JBitSet contains another one of the same size.
        Parameters:
        jBitSet - JBitSet that we want to know if it is a subset of current JBitSet
        Returns:
        boolean Whether or not jBitSet is a subset.
      • hasSingleBitSet

        public boolean hasSingleBitSet()
        See of a JBitSet has exactly 1 bit set.
        Returns:
        boolean Whether or not JBitSet has a single bit set.
      • getFirstSetBit

        public int getFirstSetBit()
        Get the first set bit (starting at index 0) from a JBitSet.
        Returns:
        int Index of first set bit, -1 if none set.
      • grow

        public void grow(int newSize)
        Grow an existing JBitSet to the specified size.
        Parameters:
        newSize - The new size
      • clearAll

        public void clearAll()
        Clear all of the bits in this JBitSet
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • get

        public boolean get(int bitIndex)
      • set

        public void set(int bitIndex)
      • clear

        public void clear(int bitIndex)
      • and

        public void and(JBitSet set)
      • or

        public void or(JBitSet set)
      • xor

        public void xor(JBitSet set)
      • size

        public int size()
        Return the size of bitSet
        Returns:
        int Size of bitSet

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.