Code example for BitSet

Methods: cardinality, nextSetBit

0
        set.set(value);
        return ret ? value : Integer.MIN_VALUE;
    } 
 
    public int getMinimum() { 
        if ( m_false.cardinality() > 0 ) {
            return m_false.nextSetBit(0);
        } else if ( m_true.cardinality() > 0 ) {
            return m_true.nextSetBit(0);
        } else { 
            return Integer.MIN_VALUE;
        } 
    } 
 
    public int getMaximum() { 
        int idx = m_true.length()-1;
        return idx>0 ? idx : m_false.length()-1;
    } 
 
    public int getMedian() { 
        int fsize = m_false.cardinality();