|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ReferenceResolver
When references are enabled, this tracks objects that have already been read or written, provides an ID for objects that are written, and looks up by ID objects that have been read.
Method Summary | |
---|---|
void |
addReadObject(int id,
java.lang.Object object)
Adds an object that has been read for the first time. |
int |
addWrittenObject(java.lang.Object object)
Returns a new ID for an object that is being written for the first time. |
java.lang.Object |
getReadObject(java.lang.Class type,
int id)
Returns the object for the specified ID. |
int |
getWrittenId(java.lang.Object object)
Returns an ID for the object if it has been written previously, otherwise returns -1. |
int |
nextReadId(java.lang.Class type)
Returns the ID for the next object that will be read. |
void |
reset()
Called by Kryo.reset() . |
void |
setKryo(Kryo kryo)
Sets the Kryo instance that this ClassResolver will be used for. |
boolean |
useReferences(java.lang.Class type)
Returns true if references will be written for the specified type. |
Method Detail |
---|
void setKryo(Kryo kryo)
int getWrittenId(java.lang.Object object)
int addWrittenObject(java.lang.Object object)
int nextReadId(java.lang.Class type)
type
- The type of object that will be read.
void addReadObject(int id, java.lang.Object object)
id
- The ID from nextReadId(Class)
.java.lang.Object getReadObject(java.lang.Class type, int id)
addReadObject(int, Object)
.
void reset()
Kryo.reset()
.
boolean useReferences(java.lang.Class type)
type
- Will never be a primitive type, but may be a primitive type wrapper.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |