|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neo4j.kernel.impl.util.Bits
public class Bits
Got bits to store, shift and retrieve and they are more than what fits in a long?
Use Bits
then.
Method Summary | |
---|---|
Bits |
apply(Buffer buffer)
Writes all bits to buffer . |
byte[] |
asBytes()
|
boolean |
available()
|
static Bits |
bits(int numberOfBytes)
|
static Bits |
bitsFromBytes(byte[] bytes)
|
static Bits |
bitsFromBytes(byte[] bytes,
int startIndex)
|
static Bits |
bitsFromLongs(long[] longs)
|
Bits |
clone()
|
byte |
getByte()
|
byte |
getByte(int steps)
|
int |
getInt()
|
int |
getInt(int steps)
|
long |
getLong()
|
long |
getLong(int steps)
|
long[] |
getLongs()
Returns the underlying long values that has got all the bits applied. |
short |
getShort()
|
short |
getShort(int steps)
|
long |
getUnsignedInt()
|
static long |
leftOverflowMask(int steps)
A mask which has the steps most significant bits set to 1, all others 0. |
static String |
numbersToBitString(byte[] values)
|
static String |
numbersToBitString(int[] values)
|
static String |
numbersToBitString(long[] values)
|
static String |
numbersToBitString(short[] values)
|
static StringBuilder |
numberToString(StringBuilder builder,
long value,
int numberOfBytes)
|
Bits |
put(byte value)
|
Bits |
put(byte value,
int steps)
|
Bits |
put(int value)
|
Bits |
put(int value,
int steps)
|
Bits |
put(long value)
|
Bits |
put(long value,
int steps)
|
Bits |
put(short value)
|
Bits |
put(short value,
int steps)
|
Bits |
read(Buffer buffer)
Reads from buffer and fills up all the bits. |
static long |
rightOverflowMask(int steps)
A mask which has the steps least significant bits set to 1, all others 0. |
String |
toString()
A very nice toString, showing each bit, divided into groups of bytes and lines of 8 bytes. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Bits bits(int numberOfBytes)
public static Bits bitsFromLongs(long[] longs)
public static Bits bitsFromBytes(byte[] bytes)
public static Bits bitsFromBytes(byte[] bytes, int startIndex)
public static long leftOverflowMask(int steps)
steps
most significant bits set to 1, all others 0.
It's used to carry bits over between carriers (longs) when shifting left.
steps
- the number of most significant bits to have set to 1 in the mask.
public static long rightOverflowMask(int steps)
steps
least significant bits set to 1, all others 0.
It's used to carry bits over between carriers (longs) when shifting right.
steps
- the number of least significant bits to have set to 1 in the mask.
public long[] getLongs()
public byte[] asBytes()
public Bits apply(Buffer buffer)
buffer
.
buffer
- the Buffer
to write to.
public Bits read(Buffer buffer)
buffer
and fills up all the bits.
buffer
- the Buffer
to read from.
public String toString()
toString
in class Object
public static StringBuilder numberToString(StringBuilder builder, long value, int numberOfBytes)
public static String numbersToBitString(byte[] values)
public static String numbersToBitString(short[] values)
public static String numbersToBitString(int[] values)
public static String numbersToBitString(long[] values)
public Bits clone()
clone
in class Object
public Bits put(byte value)
public Bits put(byte value, int steps)
public Bits put(short value)
public Bits put(short value, int steps)
public Bits put(int value)
public Bits put(int value, int steps)
public Bits put(long value)
public Bits put(long value, int steps)
public boolean available()
public byte getByte()
public byte getByte(int steps)
public short getShort()
public short getShort(int steps)
public int getInt()
public int getInt(int steps)
public long getUnsignedInt()
public long getLong()
public long getLong(int steps)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |