|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.adfnmc.java.util.BitSet
public class BitSet
The BitSet class implements a bit field. Each element in a BitSet can be on(1) or off(0). A BitSet is created with a given size and grows when this size is exceeded. Growth is always rounded to a 64 bit boundary.
Constructor Summary | |
---|---|
BitSet()
Create a new BitSet with size equal to 64 bits |
|
BitSet(int nbits)
Create a new BitSet with size equal to nbits. |
Method Summary | |
---|---|
void |
and(BitSet bs)
Performs the logical AND of this BitSet with another BitSet. |
void |
andNot(BitSet bs)
Clears all bits in the receiver which are also set in the parameter BitSet. |
int |
cardinality()
Answers the number of bits that are true in this bitset. |
void |
clear()
Clears all the bits in this bitset. |
void |
clear(int pos)
Clears the bit at index pos. |
void |
clear(int pos1,
int pos2)
Clears the bits starting from pos1 to pos2. |
boolean |
equals(java.lang.Object obj)
Compares the argument to this BitSet and answer if they are equal. |
void |
flip(int pos)
Flips the bit at index pos. |
void |
flip(int pos1,
int pos2)
Flips the bits starting from pos1 to pos2. |
boolean |
get(int pos)
Retrieve the bit at index pos. |
BitSet |
get(int pos1,
int pos2)
Retrieves the bits starting from pos1 to pos2 and answers back a new bitset made of these bits. |
int |
hashCode()
Computes the hash code for this BitSet. |
boolean |
intersects(BitSet bs)
Checks if these two bitsets have at least one bit set to true in the same position. |
boolean |
isEmpty()
Answers true if all the bits in this bitset are set to false. |
int |
length()
Returns the number of bits up to and including the highest bit set. |
int |
nextClearBit(int pos)
Answers the position of the first bit that is false on or after pos |
int |
nextSetBit(int pos)
Answers the position of the first bit that is true on or after pos |
void |
or(BitSet bs)
Performs the logical OR of this BitSet with another BitSet. |
void |
set(int pos)
Sets the bit at index pos to 1. |
void |
set(int pos,
boolean val)
Sets the bit at index pos to the value. |
void |
set(int pos1,
int pos2)
Sets the bits starting from pos1 to pos2. |
void |
set(int pos1,
int pos2,
boolean val)
Sets the bits starting from pos1 to pos2 to the given boolean value. |
int |
size()
Answers the number of bits this bitset has. |
java.lang.String |
toString()
Answers a string containing a concise, human-readable description of the receiver. |
void |
xor(BitSet bs)
Performs the logical XOR of this BitSet with another BitSet. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BitSet()
clear(int)
,
set(int)
,
clear()
,
clear(int, int)
,
set(int, boolean)
,
set(int, int)
,
set(int, int, boolean)
public BitSet(int nbits)
nbits
- the size of the bit set
java.lang.NegativeArraySizeException
- if nbits < 0.clear(int)
,
set(int)
,
clear()
,
clear(int, int)
,
set(int, boolean)
,
set(int, int)
,
set(int, int, boolean)
Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the BitSet
object to compare
hashCode()
public int hashCode()
hashCode
in class java.lang.Object
int
representing the hash code for this bit set.equals(java.lang.Object)
,
Hashtable
public boolean get(int pos)
pos
- the index of the bit to be retrieved
true
if the bit at pos
is set, false
otherwise
java.lang.IndexOutOfBoundsException
- when pos
< 0clear(int)
,
set(int)
,
clear()
,
clear(int, int)
,
set(int, boolean)
,
set(int, int)
,
set(int, int, boolean)
public BitSet get(int pos1, int pos2)
pos1
- beginning positionpos2
- ending position
java.lang.IndexOutOfBoundsException
- when pos1 or pos2 is negative, or when pos2 is not smaller than pos1get(int)
public void set(int pos)
pos
- the index of the bit to set
java.lang.IndexOutOfBoundsException
- when pos < 0clear(int)
,
clear()
,
clear(int, int)
public void set(int pos, boolean val)
pos
- the index of the bit to setval
- value to set the bit
java.lang.IndexOutOfBoundsException
- when pos < 0set(int)
public void set(int pos1, int pos2)
pos1
- beginning positionpos2
- ending position
java.lang.IndexOutOfBoundsException
- when pos1 or pos2 is negative, or when pos2 is not smaller than pos1set(int)
public void set(int pos1, int pos2, boolean val)
pos1
- beginning positionpos2
- ending positionval
- value to set these bits
java.lang.IndexOutOfBoundsException
- when pos1 or pos2 is negative, or when pos2 is not smaller than pos1set(int,int)
public void clear()
clear(int)
,
clear(int, int)
public void clear(int pos)
pos
- the index of the bit to clear
java.lang.IndexOutOfBoundsException
- when pos < 0clear(int, int)
public void clear(int pos1, int pos2)
pos1
- beginning positionpos2
- ending position
java.lang.IndexOutOfBoundsException
- when pos1 or pos2 is negative, or when pos2 is not smaller than pos1clear(int)
public void flip(int pos)
pos
- the index of the bit to flip
java.lang.IndexOutOfBoundsException
- when pos < 0flip(int, int)
public void flip(int pos1, int pos2)
pos1
- beginning positionpos2
- ending position
java.lang.IndexOutOfBoundsException
- when pos1 or pos2 is negative, or when pos2 is not smaller than pos1flip(int)
public boolean intersects(BitSet bs)
bs
- BitSet used to calculate intersect
true
if bs intersects with this BitSet, false
otherwisepublic void and(BitSet bs)
bs
- BitSet to AND withor(oracle.adfnmc.java.util.BitSet)
,
xor(oracle.adfnmc.java.util.BitSet)
public void andNot(BitSet bs)
bs
- BitSet to ANDNOT withpublic void or(BitSet bs)
bs
- BitSet to OR withxor(oracle.adfnmc.java.util.BitSet)
,
and(oracle.adfnmc.java.util.BitSet)
public void xor(BitSet bs)
bs
- BitSet to XOR withor(oracle.adfnmc.java.util.BitSet)
,
and(oracle.adfnmc.java.util.BitSet)
public int size()
length()
public int length()
public java.lang.String toString()
toString
in class java.lang.Object
public int nextSetBit(int pos)
pos
- the starting position (inclusive)
public int nextClearBit(int pos)
pos
- the starting position (inclusive)
public boolean isEmpty()
true
if the BitSet is empty, false
otherwisepublic int cardinality()
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |