|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.leeds.ccg.andyt.grids.utilities.UnsignedLong
public class UnsignedLong
A 64 bit number representing the natural numbers from 0 to 2 raised to the
power of 64.
NB. It can be better to use a look up to a Powersof2 instance
or set of them rather than calculate them on the fly.
| Constructor Summary | |
|---|---|
UnsignedLong()
Constructs a newly allocated UnsignedLong object that
represents the default long 0L. |
|
UnsignedLong(boolean[] binaryEncoding)
Constructs a newly allocated UnsignedLong object that
represents a long binary encoded by the specified
boolean[] argument. |
|
UnsignedLong(long value)
Constructs a newly allocated UnsignedLong object that
represents the specified long argument. |
|
| Method Summary | |
|---|---|
byte |
getCount()
Returns a count of the number of values of 1 in the binary encoding of value. |
long |
getLong()
Returns this.value. |
boolean |
isAtPosition(int position)
Returns true if the value of long as a binary encoding has a value of 1 at position. |
void |
setLong(long value)
Sets this.value to value. |
java.lang.String |
toBinaryString()
Returns the value of long as a binary encoded String. |
boolean[] |
toBooleanArray()
Returns this.value as a binary encoded boolean[]. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnsignedLong()
UnsignedLong object that
represents the default long 0L.
public UnsignedLong(long value)
UnsignedLong object that
represents the specified long argument.
value - The value to be represented by this.public UnsignedLong(boolean[] binaryEncoding)
UnsignedLong object that
represents a long binary encoded by the specified
boolean[] argument.
binaryEncoding - The binary encoding of the long value
to be represented by the UnsignedLong object.| Method Detail |
|---|
public long getLong()
public void setLong(long value)
value - The value this.value is set to.public boolean[] toBooleanArray()
public boolean isAtPosition(int position)
public java.lang.String toBinaryString()
public byte getCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||