public class BitArray64 extends java.lang.Object implements java.lang.Comparable<BitArray64>
| Constructor and Description |
|---|
BitArray64(BitArray64 x)
Constructs a new instance of the BitArray64 by copying
the elements from a specified BitArray64 instance.
|
BitArray64(int size)
Constructs a new instance of the BitArray64 that can
hold the specified number of BitInt64 values and initializes it
with zeros.
|
BitArray64(int size,
BitInt64 value)
Constructs a new instance of the BitArray64 that can
hold the specified number of BitInt64 values and initializes it
with the specified BitInt64 value.
|
BitArray64(int size,
boolean value)
Constructs a new instance of the BitArray64 that can
hold the specified number of BitInt64 values and initializes it
with the specified boolean value.
|
BitArray64(int size,
long value)
Constructs a new instance of the BitArray64 that can
hold the specified number of BitInt64 values and initializes it
with the specified int value.
|
| Modifier and Type | Method and Description |
|---|---|
long |
Allocate(long startWith)
Locates the position of the first occurrence of a
0 bit and sets this bit to 1.
|
boolean |
Any()
Tests whether any bit is set to 1.
|
boolean |
Any(boolean value)
Tests whether any bit is set to the specified
value.
|
boolean |
Any(long first,
long last)
Tests whether any bit is set to 1 in the range
[last, first).
|
boolean |
Any(long first,
long last,
boolean value)
Tests whether any bit is set to the specified value
in the specified range.
|
void |
Assign(BitInt64 value)
Erases all the elements in this instance and replaces
them with the specified BitInt64 value.
|
void |
Assign(boolean value)
Erases all the elements in this instance and replaces
them with the specified bit value.
|
void |
Assign(int first,
int last,
BitInt64 value)
Erases all the elements in in the range [first, last)
and replaces them with the specified BitInt64 value.
|
void |
Assign(int first,
int last,
long value)
Erases all the elements in in the range [first, last)
and replaces them with the specified int value.
|
void |
Assign(long value)
Erases all the elements in this instance and replaces
them with the specified int value.
|
void |
Assign(long first,
long last,
boolean value)
Erases all the bits in in the range [first, last)
and replaces them with the specified bit value.
|
void |
AssignAnd(BitArray64 x)
Performs the bitwise AND operation between the current
instance and a specified BitArray64 object and assigns the
result to the current instance.
|
void |
AssignOr(BitArray64 x)
Performs the bitwise OR operation between the current
instance and a specified BitArray64 object and assigns the
result to the current instance.
|
void |
AssignXor(BitArray64 x)
Performs the bitwise eXclusive OR operation between the
current instance and a specified BitArray64 object and assigns the
result to the current instance.
|
static BitArray64 |
BitwiseAnd(BitArray64 x,
BitArray64 y)
Performs the bitwise AND operation.
|
static BitArray64 |
BitwiseOr(BitArray64 x,
BitArray64 y)
Performs the bitwise OR operation.
|
static BitArray64 |
BitwiseXor(BitArray64 x,
BitArray64 y)
Performs the bitwise eXclusive OR operation.
|
int |
compareTo(BitArray64 x)
Compares this instance to a specified BitArray32 and
returns an indication of their relative values.
|
BitInt64[] |
Container()
Gets the underlying container of the current instance.
|
long |
Count(boolean value)
Counts all the bits with a specified value.
|
long |
Count(long first,
long last,
boolean value)
Counts the number of bits with a specified value in
the specified range.
|
static boolean |
Equal(BitArray64 x,
BitArray64 y)
Tests whether the values of two specified BitArray64
objects are equal.
|
boolean |
Equals(BitArray64 x)
Tests whether this instance is equal to a specified
BitArray64.
|
boolean |
equals(java.lang.Object obj)
Tests whether this instance is equal to a specified
object.
|
long |
FindFirst(boolean value)
Locates the position of the first occurrence of a
bit that has a specified value.
|
long |
FindFirst(long startWith,
boolean value)
Locates the position of the first occurrence of a
bit that has a specified value.
|
long |
FindFirst(long first,
long last,
boolean value)
Locates the position of the first occurrence of a
bit that has a specified value in a specified range.
|
long |
FindLast(boolean value)
Locates the position of the last occurrence of a
bit that has a specified value.
|
long |
FindLast(long startWith,
boolean value)
Locates the position of the last occurrence of a
bit that has a specified value.
|
long |
FindLast(long first,
long last,
boolean value)
Locates the position of the last occurrence of a
bit that has a specified value in a specified range.
|
void |
Flip()
Toggles the value of every bit.
|
void |
Flip(long pos)
Toggles the bit at a specified position.
|
void |
Flip(long first,
long last)
Toggles the bit in the range [first, last).
|
boolean |
Get(long pos)
Gets the bit at a specified position.
|
BitInt64 |
GetBitInt64(int pos)
Gets the BitInt64 element at a specified position.
|
long |
GetInt64(int pos)
Gets the int element at a specified position.
|
static boolean |
GreaterThan(BitArray64 x,
BitArray64 y)
Tests whether the value of a specified BitArray64
object is greater than another value of BitArray64 object.
|
static boolean |
GreaterThanOrEqual(BitArray64 x,
BitArray64 y)
Tests whether the value of a specified BitArray64
object is greater than or equal to another value of BitArray64 object.
|
int |
hashCode()
Returns the hash code for this instance.
|
boolean |
Item(long pos)
Gets the value of the bit at a specified position.
|
static BitArray64 |
LeftShift(BitArray64 x,
int count)
Shifts the bits in a BitArray64 to the left a specified
number of positions and returns the result.
|
void |
LeftShift(int count)
Shifts the bits in the current instance to the left
a specified number of positions and returns the result.
|
static boolean |
LessThan(BitArray64 x,
BitArray64 y)
Tests whether the value of a specified BitArray64
object is less than another value of BitArray64 object.
|
static boolean |
LessThanOrEqual(BitArray64 x,
BitArray64 y)
Tests whether the value of a specified BitArray64
object is less than or equal to another value of BitArray64 object.
|
boolean |
None()
Tests if none of the bits have been set to 1.
|
boolean |
None(boolean value)
Tests if none of the bits have been set to the specified
value.
|
boolean |
None(long first,
long last)
Tests if none of the bits have been set to 1.
|
boolean |
None(long first,
long last,
boolean value)
Tests if none of the bits have been set to the specified value
in the specified range.
|
static boolean |
NotEqual(BitArray64 x,
BitArray64 y)
Tests whether the values of two specified BitArray64
objects are not equal.
|
static BitArray64 |
OnesComplement(BitArray64 x)
Inverts all the bits in a target BitArray64 and returns
the result.
|
boolean |
PAny()
Parallel Any: Tests whether any bit is set to 1.
|
boolean |
PAny(boolean value)
Parallel Any: Tests whether any bit is set to the specified
value.
|
boolean |
PAny(long first,
long last)
Parallel Any: Tests whether any bit is set to 1 in the range
[last, first).
|
boolean |
PAny(long first,
long last,
boolean value)
Parallel Any: Tests whether any bit is set to the specified value
in the specified range.
|
void |
PAssign(BitInt64 value)
Parallel Assign: Erases all the elements in this instance and replaces
them with the specified BitInt64 value.
|
void |
PAssign(boolean value)
Parallel Assign: Erases all the elements in this instance and replaces
them with the specified bit value.
|
void |
PAssign(int first,
int last,
BitInt64 value)
Parallel Assign: Erases all the elements in in the range [first, last)
and replaces them with the specified BitInt64 value.
|
void |
PAssign(int first,
int last,
long value)
Parallel Assign: Erases all the elements in in the range [first, last)
and replaces them with the specified int value.
|
void |
PAssign(long value)
Parallel Assign: Erases all the elements in this instance and replaces
them with the specified int value.
|
void |
PAssign(long first,
long last,
boolean value)
Parallel Assign: Erases all the bits in in the range [first, last)
and replaces them with the specified bit value.
|
long |
PCount(boolean value)
Parallel Count: Counts all the bits with a specified value.
|
long |
PCount(long first,
long last,
boolean value)
Parallel Count: Counts the number of bits with a specified value in
the specified range.
|
boolean |
PEquals(BitArray64 x)
Parallel Equals: Tests whether this instance is equal to a specified
BitArray64.
|
void |
PFlip()
Parallel Flip: Toggles the value of every bit.
|
void |
PFlip(long first,
long last)
Parallel Flip: Toggles the bit in the range [first, last).
|
boolean |
PNone()
Parallel None: Tests if none of the bits have been set to 1.
|
boolean |
PNone(boolean value)
Parallel None: Tests if none of the bits have been set to the specified
value.
|
boolean |
PNone(long first,
long last)
Parallel None: Tests if none of the bits have been set to 1.
|
boolean |
PNone(long first,
long last,
boolean value)
Parallel None: Tests if none of the bits have been set to the specified value
in the specified range.
|
void |
PReset()
Parallel Reset: Sets every bit to 0.
|
void |
PReset(long first,
long last)
Parallel Reset: Sets every bit to 0 in the range [first, last).
|
void |
PSet()
Parallel Set: Sets every bit to 1.
|
void |
PSet(long first,
long last)
Parallel Set: Sets every bit to 1 in the range [first, last).
|
void |
Reset()
Sets every bit to 0.
|
void |
Reset(long pos)
Sets the bit at a specified position to 0.
|
void |
Reset(long first,
long last)
Sets every bit to 0 in the range [first, last).
|
static BitArray64 |
RightShift(BitArray64 x,
int count)
Shifts the bits in a BitArray64 to the right a specified
number of positions and returns the result.
|
void |
RightShift(int count)
Shifts the bits in the current instance to the right
a specified number of positions and returns the result.
|
void |
Set()
Sets every bit to 1.
|
void |
Set(long pos)
Sets the bit at a specified position to 1.
|
void |
Set(long first,
long last)
Sets every bit to 1 in the range [first, last).
|
void |
SetBitInt64(int pos,
BitInt64 value)
Sets the BitInt64 element at a specified position.
|
void |
SetInt64(int pos,
long value)
Sets the int element at a specified position.
|
void |
SetItem(long pos,
boolean value)
Sets the value of the bit at a specified position.
|
long |
Size()
Returns the number of bits.
|
int |
SizeInt64()
Returns the number of int elements.
|
public BitArray64(int size)
size - The number of BitInt64 in the new BitArray64.public BitArray64(int size,
boolean value)
size - The number of BitInt64 in the new BitArray64.value - The value of the bits in the new BitArray64.public BitArray64(int size,
long value)
size - The number of BitInt64 in the new BitArray64.value - The int value to assign to each element.public BitArray64(int size,
BitInt64 value)
size - The number of BitInt64 in the new BitArray64.value - The BitInt64 value to assign to each element.public BitArray64(BitArray64 x)
x - The BitArray64 to copy.public void Assign(boolean value)
value - The value of the bit being inserted
into the BitArray64.public void PAssign(boolean value)
value - The value of the bit being inserted
into the BitArray64.public void Assign(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value of the bit being inserted
into the BitArray64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PAssign(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value of the bit being inserted
into the BitArray64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void Assign(long value)
value - The value of the int being
inserted into the BitArray64.public void PAssign(long value)
value - The value of the int being
inserted into the BitArray64.public void Assign(int first,
int last,
long value)
first - Position of the first int element
in the range.last - Position that is one past the final
int element in the range.value - The value of the int being
inserted into the BitArray64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PAssign(int first,
int last,
long value)
first - Position of the first int element
in the range.last - Position that is one past the final
int element in the range.value - The value of the int being
inserted into the BitArray64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void Assign(BitInt64 value)
value - The value of the BitInt64 being
inserted into the BitArray64.public void PAssign(BitInt64 value)
value - The value of the BitInt64 being
inserted into the BitArray64.public void Assign(int first,
int last,
BitInt64 value)
first - Position of the first BitInt64 element
in the range.last - Position that is one past the final
BitInt64 element in the range.value - The value of the BitInt64 being
inserted into the BitArray64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PAssign(int first,
int last,
BitInt64 value)
first - Position of the first BitInt64 element
in the range.last - Position that is one past the final
BitInt64 element in the range.value - The value of the BitInt64 being
inserted into the BitArray64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public BitInt64[] Container()
public long Size()
public int SizeInt64()
public boolean Get(long pos)
pos - The position of the bit.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public void Set()
public void PSet()
public void Set(long pos)
pos - The position of the bit to be set to 1.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public void Set(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PSet(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void Reset()
public void PReset()
public void Reset(long pos)
pos - The position of the bit to be set to 0.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public void Reset(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PReset(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void Flip()
public void PFlip()
public void Flip(long pos)
pos - The position of the bit to be toggled.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public void Flip(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PFlip(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public long Count(boolean value)
value - The bit value to be counted.public long PCount(boolean value)
value - The bit value to be counted.public long Count(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The bit value to be counted.java.lang.RuntimeException - Thrown when the
specified range is invalid.public long PCount(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The bit value to be counted.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean Any()
public boolean PAny()
public boolean Any(boolean value)
value - The value to be tested.public boolean PAny(boolean value)
value - The value to be tested.public boolean Any(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean PAny(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean Any(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value to be tested.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean PAny(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value to be tested.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean None()
public boolean PNone()
public boolean None(boolean value)
value - The value to be tested.public boolean PNone(boolean value)
value - The value to be tested.public boolean None(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean PNone(long first,
long last)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean None(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value to be tested.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean PNone(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value to be tested.java.lang.RuntimeException - Thrown when the
specified range is invalid.public boolean Item(long pos)
pos - The position of the bit.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public void SetItem(long pos,
boolean value)
pos - The position of the bit.value - The value to be set.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public long GetInt64(int pos)
pos - The position of the int element.java.lang.RuntimeException - Thrown when the
specified position is out of [0, SizeInt64 - 1] range.public void SetInt64(int pos,
long value)
pos - The position of the int element to set.value - The new value for the specified element.java.lang.RuntimeException - Thrown when the
specified position is out of [0, SizeInt64 - 1] range.public BitInt64 GetBitInt64(int pos)
pos - The position of the BitInt64 element.java.lang.RuntimeException - Thrown when the
specified position is out of [0, SizeInt64 - 1] range.public void SetBitInt64(int pos,
BitInt64 value)
pos - The position of the BitInt64 element to set.value - The new value for the specified element.java.lang.RuntimeException - Thrown when the
specified position is out of [0, SizeInt64 - 1] range.public long FindFirst(boolean value)
value - The value to be searched for.public long FindFirst(long startWith,
boolean value)
startWith - The position where the search is to
begin.value - The value to be searched for.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public long FindFirst(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value to be searched for.java.lang.RuntimeException - Thrown when first
is out of [0, Size - 1] range.public long FindLast(boolean value)
value - The value to be searched for.public long FindLast(long startWith,
boolean value)
startWith - The position where the search is to
begin.value - The value to be searched for.java.lang.RuntimeException - Thrown when the
specified position is out of [0, Size - 1] range.public long FindLast(long first,
long last,
boolean value)
first - Position of the first bit in the range.last - Position that is one past the final
bit in the range.value - The value to be searched for.java.lang.RuntimeException - Thrown when first
is out of [0, Size - 1] range.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - An object to compare with this instance.public int hashCode()
hashCode in class java.lang.Objectpublic boolean Equals(BitArray64 x)
x - A BitArray64 to compare with this instance.public boolean PEquals(BitArray64 x)
x - A BitArray32 to compare with this instance.public int compareTo(BitArray64 x)
compareTo in interface java.lang.Comparable<BitArray64>x - An object to compare, or a null reference.public static boolean Equal(BitArray64 x, BitArray64 y)
x - The left operand in the equality to be tested.y - The right operand in the equality to be tested.public static boolean NotEqual(BitArray64 x, BitArray64 y)
x - The left operand in the equality to be tested.y - The right operand in the equality to be tested.public static boolean LessThan(BitArray64 x, BitArray64 y)
x - The left operand in the inequality to be tested.y - The right operand in the inequality to be tested.public static boolean GreaterThan(BitArray64 x, BitArray64 y)
x - The left operand in the inequality to be tested.y - The right operand in the inequality to be tested.public static boolean LessThanOrEqual(BitArray64 x, BitArray64 y)
x - The left operand in the inequality to be tested.y - The right operand in the inequality to be tested.public static boolean GreaterThanOrEqual(BitArray64 x, BitArray64 y)
x - The left operand in the inequality to be tested.y - The right operand in the inequality to be tested.public static BitArray64 BitwiseAnd(BitArray64 x, BitArray64 y)
x - The left operand in the bitwise AND operation.y - The right operand in the bitwise AND operation.public void AssignAnd(BitArray64 x)
x - The right operand in the bitwise AND operation.public static BitArray64 BitwiseOr(BitArray64 x, BitArray64 y)
x - The left operand in the bitwise OR operation.y - The right operand in the bitwise OR operation.public void AssignOr(BitArray64 x)
x - The right operand in the bitwise OR operation.public static BitArray64 BitwiseXor(BitArray64 x, BitArray64 y)
x - The left operand in the bitwise eXclusive OR operation.y - The right operand in the bitwise eXclusive OR operation.public void AssignXor(BitArray64 x)
x - The right operand in the bitwise eXclusive OR operation.public static BitArray64 OnesComplement(BitArray64 x)
x - The operand in the bitwise complement operation.public static BitArray64 LeftShift(BitArray64 x, int count)
x - A BitArray64 object whose bit values are to be shifted.count - The number of positions to the left the bits are to be shifted.public void LeftShift(int count)
count - The number of positions to the left the
bits are to be shifted.public static BitArray64 RightShift(BitArray64 x, int count)
x - A BitArray64 object whose bit values are to be shifted.count - The number of positions to the right the bits are to be shifted.public void RightShift(int count)
count - The number of positions to the right the
bits are to be shifted.public long Allocate(long startWith)
startWith - Index of the position where the
allocate is to begin.java.lang.RuntimeException - Thrown when
the specified position is out of [0, Size - 1] range.Copyright© 2012 Progeneric Systems, Inc. All Rights Reserved.