public class AbstractID extends Object implements IOReadableWritable, Comparable<AbstractID>, Serializable
| 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 |
|---|---|
int |
compareTo(AbstractID o) |
boolean |
equals(Object obj) |
long |
getLowerPart() |
long |
getUpperPart() |
int |
hashCode() |
void |
read(DataInputView in) |
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()
public long getLowerPart()
public long getUpperPart()
public 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)
public int compareTo(AbstractID o)
compareTo in interface Comparable<AbstractID>Copyright © 2015 The Apache Software Foundation. All rights reserved.