public class BitVector64
extends java.lang.Object
| Constructor and Description |
|---|
BitVector64()
Constructs a new instance of the BitVector64.
|
BitVector64(BitVector64 x)
Constructs a new instance of the BitVector64 by copying
the elements from a specified BitVector64 instance.
|
BitVector64(long size)
Constructs a new instance of the BitVector64 that can
hold the specified number of BitInt64 values and initializes it
with zeros.
|
BitVector64(long size,
BitInt64 value)
Constructs a new instance of the BitVector64 that can
hold the specified number of BitInt64 values and initializes it
with the specified BitInt64 value.
|
BitVector64(long size,
boolean value)
Constructs a new instance of the BitVector64 that can
hold the specified number of BitInt64 values and initializes it
with the specified boolean value.
|
BitVector64(long size,
long value)
Constructs a new instance of the BitVector64 that can
hold the specified number of BitInt64 values and initializes it
with the specified long 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(long value)
Erases all the elements in this instance and replaces
them with the specified long value.
|
void |
Assign(long first,
long last,
BitInt64 value)
Erases all the elements in in the range [first, last)
and replaces them with the specified BitInt64 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 |
Assign(long first,
long last,
long value)
Erases all the elements in in the range [first, last)
and replaces them with the specified long value.
|
void |
AssignAnd(BitVector64 x)
Performs the bitwise AND operation between the current
instance and a specified BitVector64 object and assigns the
result to the current instance.
|
void |
AssignOr(BitVector64 x)
Performs the bitwise OR operation between the current
instance and a specified BitVector64 object and assigns the
result to the current instance.
|
void |
AssignXor(BitVector64 x)
Performs the bitwise eXclusive OR operation between the
current instance and a specified BitVector64 object and assigns the
result to the current instance.
|
static BitVector64 |
BitwiseAnd(BitVector64 x,
BitVector64 y)
Performs the bitwise AND operation.
|
static BitVector64 |
BitwiseOr(BitVector64 x,
BitVector64 y)
Performs the bitwise OR operation.
|
static BitVector64 |
BitwiseXor(BitVector64 x,
BitVector64 y)
Performs the bitwise eXclusive OR operation.
|
void |
Clear()
Erases all of the file's elements.
|
int |
compareTo(BitVector64 x)
Compares this instance to a specified BitVector64 and
returns an indication of their relative values.
|
Vector64<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(BitVector64 x,
BitVector64 y)
Tests whether the values of two specified BitVector64
objects are equal.
|
boolean |
Equals(BitVector64 x)
Tests whether this instance is equal to a specified
BitVector64.
|
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(long pos)
Gets the BitInt64 element at a specified position.
|
long |
GetInt64(long pos)
Gets the long element at a specified position.
|
static boolean |
GreaterThan(BitVector64 x,
BitVector64 y)
Tests whether the value of a specified BitVector64
object is greater than another value of BitVector64 object.
|
static boolean |
GreaterThanOrEqual(BitVector64 x,
BitVector64 y)
Tests whether the value of a specified BitVector64
object is greater than or equal to another value of BitVector64 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 BitVector64 |
LeftShift(BitVector64 x,
int count)
Shifts the bits in a BitVector64 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(BitVector64 x,
BitVector64 y)
Tests whether the value of a specified BitVector64
object is less than another value of BitVector64 object.
|
static boolean |
LessThanOrEqual(BitVector64 x,
BitVector64 y)
Tests whether the value of a specified BitVector64
object is less than or equal to another value of BitVector64 object.
|
long |
MaxSize()
Returns the maximum size of this bit array.
|
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(BitVector64 x,
BitVector64 y)
Tests whether the values of two specified BitVector64
objects are not equal.
|
static BitVector64 |
OnesComplement(BitVector64 x)
Inverts all the bits in a target BitVector64 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(long value)
Parallel Assign: Erases all the elements in this instance and replaces
them with the specified long value.
|
void |
PAssign(long first,
long 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(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.
|
void |
PAssign(long first,
long last,
long value)
Parallel Assign: Erases all the elements in in the range [first, last)
and replaces them with the specified long 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.
|
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).
|
void |
Resize(long newSize,
boolean value)
Changes the size of this file to the given value.
|
void |
Resize(long newSize,
long value)
Changes the size of this file to the given value.
|
static BitVector64 |
RightShift(BitVector64 x,
int count)
Shifts the bits in a BitVector64 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(long pos,
BitInt64 value)
Sets the BitInt64 element at a specified position.
|
void |
SetInt64(long pos,
long value)
Sets the long 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.
|
long |
SizeInt64()
Returns the number of long elements.
|
public BitVector64()
public BitVector64(long size)
size - The number of BitInt64 in the new BitVector64.public BitVector64(long size,
boolean value)
size - The number of BitInt64 in the new BitVector64.value - The value of the bits in the new BitVector64.public BitVector64(long size,
long value)
size - The number of BitInt64 in the new BitVector64.value - The long value to assign to each element.public BitVector64(long size,
BitInt64 value)
size - The number of BitInt64 in the new BitVector64.value - The BitInt64 value to assign to each element.public BitVector64(BitVector64 x)
x - The BitVector64 to copy.public void Assign(boolean value)
value - The value of the bit being inserted
into the BitVector64.public void PAssign(boolean value)
value - The value of the bit being inserted
into the BitVector64.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 BitVector64.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 BitVector64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void Assign(long value)
value - The value of the long being
inserted into the BitVector64.public void PAssign(long value)
value - The value of the long being
inserted into the BitVector64.public void Assign(long first,
long last,
long value)
first - Position of the first long element
in the range.last - Position that is one past the final
long element in the range.value - The value of the long being
inserted into the BitVector64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PAssign(long first,
long last,
long value)
first - Position of the first long element
in the range.last - Position that is one past the final
long element in the range.value - The value of the long being
inserted into the BitVector64.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 BitVector64.public void PAssign(BitInt64 value)
value - The value of the BitInt64 being
inserted into the BitVector64.public void Assign(long first,
long 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 BitVector64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public void PAssign(long first,
long 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 BitVector64.java.lang.RuntimeException - Thrown when the
specified range is invalid.public Vector64<BitInt64> Container()
public long Size()
public long SizeInt64()
public long MaxSize()
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(long pos)
pos - The position of the long element.java.lang.RuntimeException - Thrown when the
specified position is out of [0, SizeInt64() - 1] range.public void SetInt64(long pos,
long value)
pos - The position of the long 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(long 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(long 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 the
specified range is invalid.public void Resize(long newSize,
boolean value)
newSize - The new size (number of BitInt64) of the BitVector64.value - The long value of new elements added to the
BitVector64, if the new size is larger than the original size.public void Resize(long newSize,
long value)
newSize - The new size (number of BitInt64) of the BitVector64.value - The boolean value of new elements added to the
BitVector64, if the new size is larger than the original size.public void Clear()
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(BitVector64 x)
x - A BitVector64 to compare with this instance.public int compareTo(BitVector64 x)
x - An object to compare, or a null reference.public static boolean Equal(BitVector64 x, BitVector64 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(BitVector64 x, BitVector64 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(BitVector64 x, BitVector64 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(BitVector64 x, BitVector64 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(BitVector64 x, BitVector64 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(BitVector64 x, BitVector64 y)
x - The left operand in the inequality to be tested.y - The right operand in the inequality to be tested.public static BitVector64 BitwiseAnd(BitVector64 x, BitVector64 y)
x - The left operand in the bitwise AND operation.y - The right operand in the bitwise AND operation.public void AssignAnd(BitVector64 x)
x - The right operand in the bitwise AND operation.public static BitVector64 BitwiseOr(BitVector64 x, BitVector64 y)
x - The left operand in the bitwise OR operation.y - The right operand in the bitwise OR operation.public void AssignOr(BitVector64 x)
x - The right operand in the bitwise OR operation.public static BitVector64 BitwiseXor(BitVector64 x, BitVector64 y)
x - The left operand in the bitwise eXclusive OR operation.y - The right operand in the bitwise eXclusive OR operation.public void AssignXor(BitVector64 x)
x - The right operand in the bitwise eXclusive OR operation.public static BitVector64 OnesComplement(BitVector64 x)
x - The operand in the bitwise complement operation.public static BitVector64 LeftShift(BitVector64 x, int count)
x - A BitVector64 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 BitVector64 RightShift(BitVector64 x, int count)
x - A BitVector64 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.