All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----cryptix.util.math.BigRegister
The bits are indexed from 0 (rightmost) to size
- 1, (leftmost) where size is this register's
designated (at instantiation time) bit capacity.
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.1.1.1 $
BigRegister object.
BigRegister of a given size
with all its bits set to zeroes.
this &= source.
this &= ~source.
this BigRegister object with random data
generated from the default source.
this BigRegister object with random data
generated from a designated source.
this BigRegister.
this.
this BigRegister's contents to that of the
argument, returning -1, 0 or 1 for less than, equal to, or greater
than comparison result.
this.
count bits starting at offset n
framed in a long, right justified and left padded
with binary zeroes.
size of this object as
specified at its instantiation time.
this.
this BigRegister
as an int.
this.
size and bits) are equal to this one;
false otherwise.
this.
this.
this BigRegister
as a long.
this.
this = ~this.
this |= source.
this BigRegister's bits.
size of this
register.
size of this
register.
count bits starting at offset n
to a given value.
this BigRegister's contents
by a given number of bit positions.
this BigRegister's contents
by a given number of bit positions.
this BigRegister's contents in a
byte array with the LSB at index position 0.
String representation of the binary
contents of this.
BigRegister, of the same size
as this set to the specified value.
this ^= source.
public static final int MAXIMUM_SIZE
BigRegister object.
public BigRegister(int size)
BigRegister of a given size
with all its bits set to zeroes.
this object.
public Object clone()
this.
public void and(BigRegister source)
this &= source.
size than this.
public void andNot(BigRegister source)
this &= ~source.
size than this.
public void or(BigRegister source)
this |= source.
size than this.
public void not()
this = ~this.
public void xor(BigRegister source)
this ^= source.
size than this.
public void shiftLeft(int n)
this BigRegister's contents
by a given number of bit positions. If the number is negative, a
right shift is executed.
public void shiftRight(int n)
this BigRegister's contents
by a given number of bit positions. If the number is negative, a
left shift is executed.
public void rotateLeft(int n)
size of this
register.
Effectively compute this = this << n | this >> (size - n).
If the number of positions to rotate by is negative, then a right instead of left rotation is executed.
public void rotateRight(int n)
size of this
register.
Effectively compute this = this >> n | this << (size - n).
If the number of positions to rotate by is negative, then a left instead of right rotation is executed.
public void invertOrder()
this.
public boolean testBit(int n)
public boolean isSameValue(BigRegister x)
size and bits) are equal to this one;
false otherwise.
NOTE: the equals method is not used, because this is
a mutable object (see the requirements for equals in the Java Language
Spec).
size and contents.
public int compareTo(BigRegister x)
this BigRegister's contents to that of the
argument, returning -1, 0 or 1 for less than, equal to, or greater
than comparison result.
BigRegister object to compare to.
this object are
respectively less than, equal to, or greater than those
of the argument.
public void setBit(int n)
ArrayOutOfBOundsException while
accessing the bits array.
public void setBits(int n,
int count,
long value)
count bits starting at offset n
to a given value.
long.
ArrayOutOfBOundsException while
accessing the bits array, or count is < 1 or
> 64.
public void clearBit(int n)
ArrayOutOfBOundsException while
accessing the bits array.
public void flipBit(int n)
ArrayOutOfBOundsException while
accessing the bits array.
public int getBit(int n)
ArrayOutOfBOundsException while
accessing the bits array.
public long getBits(int n,
int count)
count bits starting at offset n
framed in a long, right justified and left padded
with binary zeroes.
count bits starting from bit
index n in a java long.
ArrayOutOfBOundsException while
accessing the bits array, or count is < 1 or
> 64.
public int byteValue()
this BigRegister.
this.
public int intValue()
this BigRegister
as an int.
this as an
int.
public long longValue()
this BigRegister
as a long.
this as a
long.
public BigRegister valueOf(long n)
BigRegister, of the same size
as this set to the specified value.
BigRegister, of the same size
as this set to the specified value.
public void reset()
this BigRegister's bits.
public void atRandom()
this BigRegister object with random data
generated from the default source.
public void atRandom(SecureRandom source)
this BigRegister object with random data
generated from a designated source.
public void load(BigRegister source)
this.
size than this.
public void load(byte source[])
this.
Byte array order is assumed to have its Least Significant Byte
(LSB) at index position 0. This format mirrors that of the output
returned by the toByteArray() method.
Bits unprovided for in the source array are cleared.
It is a more tolerant way of initialising a register than that
obtained by invoking the same method with a BigRegister
argument.
size than this.
public byte[] toByteArray()
this BigRegister's contents in a
byte array with the LSB at index position 0. This format is
compatible with the load([B) method of this class.
this in a byte array with the
LSB at index position 0.
public int getSize()
size of this object as
specified at its instantiation time.
size of this object
as specified at its instantiation time.
public int countSetBits()
this.
this.
public int highestSetBit()
this.
this, or
-1 if all bits are zeroes.
public int lowestSetBit()
this.
this, or
-1 if all bits are zeroes.
public String toString()
String representation of the binary
contents of this.
this.
All Packages Class Hierarchy This Package Previous Next Index