public class LinkedNodePortability<T> extends Object implements WriteBackPortability<LinkedNode<T>>, PersistentPortability<LinkedNode<T>>
| Modifier and Type | Field and Description |
|---|---|
static int |
LSN_OFFSET |
static int |
NEXT_OFFSET |
static int |
PREVIOUS_OFFSET |
static int |
VALUE_OFFSET |
| Constructor and Description |
|---|
LinkedNodePortability(Portability<? super T> valuePortability) |
| Modifier and Type | Method and Description |
|---|---|
void |
bootstrap(ObjectInput input) |
void |
close() |
LinkedNode<T> |
decode(ByteBuffer buffer)
Decodes a
ByteBuffer to an object of type T. |
LinkedNode<T> |
decode(ByteBuffer buffer,
WriteContext context) |
static ByteBuffer |
emptyHeader() |
ByteBuffer |
encode(LinkedNode<T> object)
Encodes an object of type
T as a ByteBuffer. |
boolean |
equals(Object object,
ByteBuffer buffer)
Returns true if the encoded object once decoded would be
Object.equals(Object) to the supplied object. |
void |
flush() |
void |
persist(ObjectOutput output) |
public static final int LSN_OFFSET
public static final int PREVIOUS_OFFSET
public static final int NEXT_OFFSET
public static final int VALUE_OFFSET
public LinkedNodePortability(Portability<? super T> valuePortability)
public ByteBuffer encode(LinkedNode<T> object)
PortabilityT as a ByteBuffer.encode in interface Portability<LinkedNode<T>>object - object to be encodedpublic LinkedNode<T> decode(ByteBuffer buffer)
PortabilityByteBuffer to an object of type T.decode in interface Portability<LinkedNode<T>>buffer - bytes to decodepublic boolean equals(Object object, ByteBuffer buffer)
PortabilityObject.equals(Object) to the supplied object.equals in interface Portability<LinkedNode<T>>object - object to compare tobuffer - buffer containing encoded objecttrue if the two parameters are "equal"public LinkedNode<T> decode(ByteBuffer buffer, WriteContext context)
decode in interface WriteBackPortability<LinkedNode<T>>public void flush()
throws IOException
flush in interface PersistentIOExceptionpublic void close()
throws IOException
close in interface PersistentIOExceptionpublic void persist(ObjectOutput output) throws IOException
persist in interface PersistentIOExceptionpublic void bootstrap(ObjectInput input) throws IOException
bootstrap in interface PersistentIOExceptionpublic static ByteBuffer emptyHeader()
Copyright © 2015–2024. All rights reserved.