public class AbstractID extends Object implements IOReadableWritable
| Modifier and Type | Field and Description |
|---|---|
static int |
SIZE
The size of the ID in byte
|
| Constructor and Description |
|---|
AbstractID()
Constructs a new random ID from a uniform distribution.
|
AbstractID(AbstractID id)
Creates a new abstract ID from the given one.
|
AbstractID(byte[] bytes)
Constructs a new ID with a specific bytes value.
|
AbstractID(long lowerPart,
long upperPart)
Constructs a new abstract ID.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
protected static long |
generateRandomLong()
Generates a uniformly distributed random positive long.
|
int |
hashCode() |
void |
read(DataInputView in) |
void |
setID(AbstractID src)
Sets an ID from another ID by copying its internal byte representation.
|
String |
toString() |
void |
write(ByteBuffer buffer) |
void |
write(DataOutputView out) |
void |
writeTo(io.netty.buffer.ByteBuf buf) |
public static final int SIZE
public AbstractID(byte[] bytes)
public AbstractID(long lowerPart,
long upperPart)
lowerPart - the lower bytes of the IDupperPart - the higher bytes of the IDpublic AbstractID(AbstractID id)
The given and the newly created abstract ID will be identical, i.e. a comparison by equals will
return true and both objects will have the same hash code.
id - the abstract ID to copypublic AbstractID()
protected static long generateRandomLong()
public void setID(AbstractID src)
src - source IDpublic void read(DataInputView in) throws IOException
read in interface IOReadableWritableIOExceptionpublic void write(DataOutputView out) throws IOException
write in interface IOReadableWritableIOExceptionpublic void write(ByteBuffer buffer)
public void writeTo(io.netty.buffer.ByteBuf buf)
Copyright © 2014 The Apache Software Foundation. All rights reserved.