|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wegra.util.bitset.BitSetManipulator
BitSet manipulator.
Constructor Summary | |
BitSetManipulator()
|
Method Summary | |
static BitSet |
add(BitSet opr1,
BitSet opr2)
Performs a ADD operation given two bitset and return result.
|
static BitSet |
and(BitSet opr1,
BitSet opr2)
Performs a logical AND of given two bitset.
|
static int |
compare(BitSet opr1,
BitSet opr2)
Compares given two arguments for order. |
static BitSet |
concat(BitSet[] src)
Concatenates given BitSets |
static BitSet |
div(BitSet opr1,
BitSet opr2)
Performs division operation to opr1 by opr2 ,
and returns result. |
static BitSet |
extendSign(BitSet source,
int outputLength)
extends the sign bit of source and create new BitSet of outputLength. |
static BitSet |
mul(BitSet opr1,
BitSet opr2)
Multiply given two bit set and returns result. |
static BitSet |
or(BitSet opr1,
BitSet opr2)
Performs a logical OR of given two bitset.
|
static BitSet |
reverse(BitSet set)
Reverses bit pattern of given set. |
static BitSet |
shiftLeft(BitSet opr,
int length)
Performs logical left shift. |
static BitSet |
shiftRight(BitSet opr,
int length)
Performs logical right shift. |
static BitSet |
shiftRightArithmetic(BitSet opr,
int length)
Performs arithmetic right shift. |
static BitSet |
sub(BitSet opr1,
BitSet opr2)
Substracts opr2 from opr1 , and return result.
|
static BitSet |
toBitSet(boolean[] bits)
Create new BitSet from given boolean array. |
static BitSet |
toBitSet(byte[] bytes)
Create new BitSet from given byte array. |
static BitSet |
toBitSet(int value)
Create new 32bits BitSet from given integer. |
static BitSet |
toBitSet(int value,
int length)
Create new BitSet from given integer. |
static BitSet |
toBitSet(long value)
Create new BitSet from given long integer. |
static BitSet |
toBitSet(java.lang.String bitsString)
Create new BitSet from given bits string. |
static boolean[] |
toBooleanArray(BitSet source)
Converts given BitSet source to boolean array . |
static byte[] |
toByteArray(BitSet source)
Converts given BitSet source to byte array . |
static int |
toInteger(BitSet source)
Converts given BitSet source to int value. |
static long |
toLong(BitSet source)
Converts given BitSet source to long value. |
static BitSet |
xor(BitSet opr1,
BitSet opr2)
Performs a logical XOR of given two bitset.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BitSetManipulator()
Method Detail |
public static BitSet and(BitSet opr1, BitSet opr2)
AND
of given two bitset.
Two given bit set must have same length.
public static BitSet or(BitSet opr1, BitSet opr2)
OR
of given two bitset.
Two given bit set must have same length.
public static BitSet xor(BitSet opr1, BitSet opr2)
XOR
of given two bitset.
Two given bit set must have same length.
public static BitSet add(BitSet opr1, BitSet opr2)
ADD
operation given two bitset and return result.
Two given bit set must have same length.
public static BitSet sub(BitSet opr1, BitSet opr2)
opr2
from opr1
, and return result.
public static BitSet mul(BitSet opr1, BitSet opr2)
public static BitSet div(BitSet opr1, BitSet opr2)
opr1
by opr2
,
and returns result.
public static BitSet shiftLeft(BitSet opr, int length)
opr
- the operand.length
- length to shift.
public static BitSet shiftRight(BitSet opr, int length)
opr
- the operand.length
- length to shift.
public static BitSet shiftRightArithmetic(BitSet opr, int length)
opr
- the operand.length
- length to shift.
public static int compare(BitSet opr1, BitSet opr2)
opr1
- the first object to be compared.opr2
- the second object to be compared.
public static BitSet extendSign(BitSet source, int outputLength)
source
- source BitSetoutputLength
- length of output BitSet
public static BitSet concat(BitSet[] src)
public static BitSet reverse(BitSet set)
public static BitSet toBitSet(byte[] bytes)
public static BitSet toBitSet(boolean[] bits)
public static BitSet toBitSet(int value)
public static BitSet toBitSet(int value, int length)
public static BitSet toBitSet(long value)
public static BitSet toBitSet(java.lang.String bitsString)
public static boolean[] toBooleanArray(BitSet source)
source
to boolean array
.
source
- the source to convert
boolean array
from the source
public static byte[] toByteArray(BitSet source)
source
to byte array
.
source
- the source to convert
byte array
from the source
public static int toInteger(BitSet source)
source
to int
value.
source
- the source to convert
int
value from the source
public static long toLong(BitSet source)
source
to long
value.
source
- the source to convert
long
value from the source
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |