18#ifndef _DECAF_UTIL_BITSET_H_
19#define _DECAF_UTIL_BITSET_H_
50 unsigned long long* bits;
57 mutable int actualArrayLength;
58 mutable bool isLengthActual;
62 BitSet(
unsigned long long* bits,
int bitsSize,
bool needClear,
int actualArrayLength,
bool isLengthActual);
92 BitSet& operator= (
const BitSet&
set);
103 return this->
equals(other);
113 return !this->
equals(other);
181 void clear(
int fromIndex,
int toIndex);
218 void flip(
int fromIndex,
int toIndex);
231 bool get(
int index)
const;
247 BitSet
get(
int fromIndex,
int toIndex)
const;
321 void set(
int index,
bool value);
335 void set(
int fromIndex,
int toIndex);
351 void set(
int fromIndex,
int toIndex,
bool value);
395 void ensureCapacity(
int length);
405 int getActualArrayLength()
const;
bool equals(const BitSet &set) const
Compares this object against the specified object.
void set(int fromIndex, int toIndex)
Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to true.
void XOR(const BitSet &set)
Performs a logical XOR of this bit set with the bit set argument.
bool operator!=(const BitSet &other) const
Boolean comparison operator !=.
Definition BitSet.h:112
void set(int index, bool value)
Sets the bit at the specified index to the specified value.
void set(int index)
Sets the bit at the specified index to true.
void clear()
Sets all of the bits in this BitSet to false.
bool get(int index) const
Returns the value of the bit with the specified index.
BitSet get(int fromIndex, int toIndex) const
Returns a new BitSet composed of bits from this BitSet from fromIndex (inclusive) to toIndex (exclusi...
int nextClearBit(int index) const
Returns the index of the first bit that is set to false that occurs on or after the specified startin...
bool intersects(const BitSet &set) const
Returns true if the specified BitSet has any bits set to true that are also set to true in this BitSe...
int cardinality()
Returns the number of bits set to true in this BitSet.
BitSet()
Creates a new BitSet whose bits are all false.
void set(int fromIndex, int toIndex, bool value)
Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to the va...
std::string toString() const
Returns a string representation of this bit set.
int length() const
Returns the "logical size" of this BitSet: the index of the highest set bit in the BitSet plus one.
void flip(int fromIndex, int toIndex)
Sets each bit from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to the co...
bool operator==(const BitSet &other) const
Boolean comparison operator ==.
Definition BitSet.h:102
BitSet(int bitCount)
Creates a bit set whose initial size is large enough to explicitly represent bits with indices in the...
void OR(const BitSet &set)
Performs a logical OR of this bit set with the bit set argument.
int nextSetBit(int index) const
Returns the index of the first bit that is set to true that occurs on or after the specified starting...
bool isEmpty() const
Returns true if this BitSet contains no bits that are set to true.
void clear(int index)
Sets the bit specified by the index to false.
int size() const
Returns the number of bits of space actually in use by this BitSet to represent bit values.
void clear(int fromIndex, int toIndex)
Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to false.
void andNot(const BitSet &set)
Clears all of the bits in this BitSet whose corresponding bit is set in the specified BitSet.
void AND(const BitSet &set)
Performs a logical AND of this target bit set with the argument bit set.
BitSet(const BitSet &set)
Copy Constructor.
void flip(int index)
Sets the bit at the specified index to the complement of its current value.
#define DECAF_API
Definition Config.h:29
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25