Package | com.yworks.bridge.util |
Class | public class BitSet |
Inheritance | BitSet YObject Object |
Implements | Clonable |
Property | Defined By | ||
---|---|---|---|
empty : Boolean [read-only]
Answers true if all the bits in this bitset are set to false. | BitSet |
Method | Defined By | ||
---|---|---|---|
BitSet(init:Boolean = true)
Create a new BitSet with size equal to 64 bits
| BitSet | ||
Performs the logical AND of this BitSet with another BitSet. | BitSet | ||
Clears all bits in the receiver which are also set in the parameter BitSet. | BitSet | ||
cardinality():int
Answers the number of bits that are true in this bitset. | BitSet | ||
clear():void
Clears all the bits in this bitset. | BitSet | ||
clearBit(pos:int):void
Clears the bit at index pos. | BitSet | ||
clearBits(pos1:int, pos2:int):void
Clears the bits starting from pos1 to pos2. | BitSet | ||
clone():Object
Create a copy of this BitSet
| BitSet | ||
equals(obj:Object):Boolean [override]
Compares the argument to this BitSet and answer if they are equal. | BitSet | ||
flipBit(pos:int):void
Flips the bit at index pos. | BitSet | ||
flipBits(pos1:int, pos2:int):void
Flips the bits starting from pos1 to pos2. | BitSet | ||
getBit(pos:int):Boolean
Retrieve the bit at index pos. | BitSet | ||
Retrieves the bits starting from pos1 to pos2 and answers back a new bitset made of these bits. | BitSet | ||
getClass():Class [override] | BitSet | ||
hashCode():int [override]
Computes the hash code for this BitSet. | BitSet | ||
intersects(bs:BitSet):Boolean
Checks if these two bitsets have at least one bit set to true in the same position. | BitSet | ||
length():int
Returns the number of bits up to and including the highest bit set. | BitSet | ||
[static]
Create a new BitSet with size equal to 64 bits
| BitSet | ||
newBitSet2(nbits:int):BitSet [static]
Create a new BitSet with size equal to nbits. | BitSet | ||
nextClearBit(pos:int):int
Answers the position of the first bit that is false on or after pos
| BitSet | ||
nextSetBit(pos:int):int
Answers the position of the first bit that is true on or after pos
| BitSet | ||
Performs the logical OR of this BitSet with another BitSet. | BitSet | ||
setBit(pos:int):void
Sets the bit at index pos to 1. | BitSet | ||
setBits(pos1:int, pos2:int):void
Sets the bits starting from pos1 to pos2. | BitSet | ||
setBitsValue(pos1:int, pos2:int, val:Boolean):void
Sets the bits starting from pos1 to pos2 to the given boolean value. | BitSet | ||
setBitValue(pos:int, val:Boolean):void
Sets the bit at index pos to the value. | BitSet | ||
size():int
Answers the number of bits this bitset has. | BitSet | ||
toString():String
Answers a string containing a concise, human-readable description of the receiver. | BitSet | ||
Performs the logical XOR of this BitSet with another BitSet. | BitSet |
Method | Defined By | ||
---|---|---|---|
cloneImpl(o:Object):void | BitSet | ||
initBitSet1():void
Initializes this object. | BitSet | ||
initBitSet2(nbits:int):void
Initializes this object. | BitSet |
empty | property |
empty:Boolean
[read-only] Answers true if all the bits in this bitset are set to false.
public function get empty():Boolean
BitSet | () | Constructor |
public function BitSet(init:Boolean = true)
Create a new BitSet with size equal to 64 bits
Parametersinit:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
See also
and | () | method |
public function and(bs:BitSet):void
Performs the logical AND of this BitSet with another BitSet.
Parameters
bs:BitSet — BitSet to AND with
|
See also
andNot | () | method |
public function andNot(bs:BitSet):void
Clears all bits in the receiver which are also set in the parameter BitSet.
Parameters
bs:BitSet — BitSet to ANDNOT with
|
cardinality | () | method |
public function cardinality():int
Answers the number of bits that are true in this bitset.
Returnsint — the number of true bits in the set
|
clear | () | method |
clearBit | () | method |
public function clearBit(pos:int):void
Clears the bit at index pos. Grows the BitSet if pos > size.
Parameters
pos:int — the index of the bit to clear
|
RangeError — when pos < 0
|
See also
clearBits | () | method |
public function clearBits(pos1:int, pos2:int):void
Clears the bits starting from pos1 to pos2. Grows the BitSet if pos2 > size.
Parameters
pos1:int — beginning position
| |
pos2:int — ending position
|
RangeError — when pos1 or pos2 is negative, or when pos2 is not smaller than pos1
|
See also
clone | () | method |
public function clone():Object
Create a copy of this BitSet
ReturnsObject — A copy of this BitSet.
|
cloneImpl | () | method |
protected function cloneImpl(o:Object):void
Parameters
o:Object |
equals | () | method |
override public function equals(obj:Object):Boolean
Compares the argument to this BitSet and answer if they are equal. The object must be an instance of BitSet with the same bits set.
Parameters
obj:Object — the BitSet object to compare
|
Boolean — A boolean indicating whether or not this BitSet and obj are equal
|
See also
flipBit | () | method |
public function flipBit(pos:int):void
Flips the bit at index pos. Grows the BitSet if pos > size.
Parameters
pos:int — the index of the bit to flip
|
RangeError — when pos < 0
|
See also
flipBits | () | method |
public function flipBits(pos1:int, pos2:int):void
Flips the bits starting from pos1 to pos2. Grows the BitSet if pos2 > size.
Parameters
pos1:int — beginning position
| |
pos2:int — ending position
|
RangeError — when pos1 or pos2 is negative, or when pos2 is not smaller than pos1
|
See also
getBit | () | method |
public function getBit(pos:int):Boolean
Retrieve the bit at index pos. Grows the BitSet if pos > size.
Parameters
pos:int — the index of the bit to be retrieved
|
Boolean — true if the bit at pos is set, false otherwise
|
RangeError — when pos < 0
|
See also
getBits | () | method |
public function getBits(pos1:int, pos2:int):BitSet
Retrieves the bits starting from pos1 to pos2 and answers back a new bitset made of these bits. Grows the BitSet if pos2 > size.
Parameters
pos1:int — beginning position
| |
pos2:int — ending position
|
BitSet — new bitset
|
RangeError — when pos1 or pos2 is negative, or when pos2 is not smaller than pos1
|
See also
getClass | () | method |
override public function getClass():Class
ReturnsClass |
hashCode | () | method |
override public function hashCode():int
Computes the hash code for this BitSet.
Returnsint — The int representing the hash code for this bit set.
|
See also
initBitSet1 | () | method |
protected final function initBitSet1():void
Initializes this object. See the documentation of the corresponding factory method newBitSet1()
for details.
See also
initBitSet2 | () | method |
protected final function initBitSet2(nbits:int):void
Initializes this object. See the documentation of the corresponding factory method newBitSet2()
for details.
Parameters
nbits:int |
See also
intersects | () | method |
public function intersects(bs:BitSet):Boolean
Checks if these two bitsets have at least one bit set to true in the same position.
Parameters
bs:BitSet — BitSet used to calculate intersect
|
Boolean — true if bs intersects with this BitSet, false otherwise
|
length | () | method |
public function length():int
Returns the number of bits up to and including the highest bit set.
Returnsint — the length of the BitSet
|
newBitSet1 | () | method |
public static function newBitSet1():BitSet
Create a new BitSet with size equal to 64 bits
ReturnsBitSet |
See also
newBitSet2 | () | method |
public static function newBitSet2(nbits:int):BitSet
Create a new BitSet with size equal to nbits. If nbits is not a multiple of 64, then create a BitSet with size nbits rounded to the next closest multiple of 64.
Parameters
nbits:int — the size of the bit set
|
BitSet |
RangeError — if nbits < 0 .
|
See also
nextClearBit | () | method |
public function nextClearBit(pos:int):int
Answers the position of the first bit that is false on or after pos
Parameters
pos:int — the starting position (inclusive)
|
int — the position of the next bit set to false, even if it is further than this bitset's size.
|
nextSetBit | () | method |
public function nextSetBit(pos:int):int
Answers the position of the first bit that is true on or after pos
Parameters
pos:int — the starting position (inclusive)
|
int — -1 if there is no bits that are set to true on or after pos.
|
or | () | method |
public function or(bs:BitSet):void
Performs the logical OR of this BitSet with another BitSet.
Parameters
bs:BitSet — BitSet to OR with
|
See also
setBit | () | method |
public function setBit(pos:int):void
Sets the bit at index pos to 1. Grows the BitSet if pos > size.
Parameters
pos:int — the index of the bit to set
|
RangeError — when pos < 0
|
See also
setBits | () | method |
public function setBits(pos1:int, pos2:int):void
Sets the bits starting from pos1 to pos2. Grows the BitSet if pos2 > size.
Parameters
pos1:int — beginning position
| |
pos2:int — ending position
|
RangeError — when pos1 or pos2 is negative, or when pos2 is not smaller than pos1
|
See also
setBitsValue | () | method |
public function setBitsValue(pos1:int, pos2:int, val:Boolean):void
Sets the bits starting from pos1 to pos2 to the given boolean value. Grows the BitSet if pos2 > size.
Parameters
pos1:int — beginning position
| |
pos2:int — ending position
| |
val:Boolean — value to set these bits
|
RangeError — when pos1 or pos2 is negative, or when pos2 is not smaller than pos1
|
See also
setBitValue | () | method |
public function setBitValue(pos:int, val:Boolean):void
Sets the bit at index pos to the value. Grows the BitSet if pos > size.
Parameters
pos:int — the index of the bit to set
| |
val:Boolean — value to set the bit
|
RangeError — when pos < 0
|
See also
size | () | method |
public function size():int
Answers the number of bits this bitset has.
Returnsint — The number of bits contained in this BitSet.
|
See also
toString | () | method |
public function toString():String
Answers a string containing a concise, human-readable description of the receiver.
ReturnsString — A comma delimited list of the indices of all bits that are set.
|
xor | () | method |
public function xor(bs:BitSet):void
Performs the logical XOR of this BitSet with another BitSet.
Parameters
bs:BitSet — BitSet to XOR with
|
See also