-
- All Superinterfaces:
Scope
- All Known Implementing Classes:
DefaultScope
public interface ScopeMixin extends Scope
Scopeimplementation that can be mixed in to another class.- Author:
- Bernhard Haumacher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidenter(SharedGraphNode node, int id)Assigns the given ID to the given node.intid(SharedGraphNode node)Looks up the ID of the given node in thisScope.Map<Object,SharedGraphNode>index()The index implementation associating object with IDs.voidinitId(SharedGraphNode node, int id)Assigns the given ID to the given node.intnewId()Creates a fresh ID.default voidreadData(SharedGraphNode node, int id, JsonReader in)Reads object data of the given node and assigns the given ID to this node.default SharedGraphNoderesolveOrFail(int id)Looks up the object with the given ID.default voidwriteRefOrData(JsonWriter out, SharedGraphNode node)Writes the given graph node to the given writer.
-
-
-
Method Detail
-
resolveOrFail
default SharedGraphNode resolveOrFail(int id)
Description copied from interface:ScopeLooks up the object with the given ID.- Specified by:
resolveOrFailin interfaceScope- Parameters:
id- The ID of the requested object.- Returns:
- The object with the given ID.
-
enter
default void enter(SharedGraphNode node, int id)
Assigns the given ID to the given node.
-
readData
default void readData(SharedGraphNode node, int id, JsonReader in) throws IOException
Description copied from interface:ScopeReads object data of the given node and assigns the given ID to this node.- Specified by:
readDatain interfaceScope- Parameters:
node- The node to read data for.id- The ID to assign ot the given node.- Throws:
IOException
-
writeRefOrData
default void writeRefOrData(JsonWriter out, SharedGraphNode node) throws IOException
Description copied from interface:ScopeWrites the given graph node to the given writer.If the node has already an ID in this scope, only the ID is transmitted as plain numeric value. Otherwise, a fresh ID is assigned to the node and the the full data of the given node is transmitted (by calling back to
SharedGraphNode.writeData(Scope, JsonWriter, int)).- Specified by:
writeRefOrDatain interfaceScope- Parameters:
out- TheJsonWriterto write to.node- The graph node to transmit.- Throws:
IOException
-
id
int id(SharedGraphNode node)
Looks up the ID of the given node in thisScope.- See Also:
initId(SharedGraphNode, int)
-
initId
void initId(SharedGraphNode node, int id)
Assigns the given ID to the given node.- See Also:
id(SharedGraphNode)
-
newId
int newId()
Creates a fresh ID.
-
index
Map<Object,SharedGraphNode> index()
The index implementation associating object with IDs.
-
-