- All Superinterfaces:
Observable,ReflectiveDataObject
- All Known Implementing Classes:
AbstractSharedGraphNode
Object in a shared graph.
A shared graph is a collection of interconnected objects that exist on multiple host computers. All graphs are observed for modifications. Modifications on one host can be transmitted as patch to all other participants and applied there to keep the shared graph in sync.
-
Method Summary
Modifier and TypeMethodDescriptionreadElement(Scope scope, JsonReader in, String field) Read an element of the repeated field with the given name.voidreadField(Scope scope, JsonReader in, String field) Reads the given field from the given input.voidreadFields(Scope scope, JsonReader in) Reads all fields of this instance from the given input.voidwriteData(Scope scope, JsonWriter out, int id) Writes the complete data of this node including type and ID to the given writer.voidwriteElement(Scope scope, JsonWriter out, String field, Object element) Writes the given element value that is compatible with the repeated field with the given name to the given output.voidwriteFieldValue(Scope scope, JsonWriter out, String field) Writes a single value that is currently assigned to the field with the given name to the given writer.voidwriteTo(Scope scope, JsonWriter out) Writes this node to the given writer.Methods inherited from interface de.haumacher.msgbuf.observer.Observable
registerListener, unregisterListenerMethods inherited from interface de.haumacher.msgbuf.data.ReflectiveDataObject
get, jsonType, properties, set
-
Method Details
-
writeTo
Writes this node to the given writer.Depending on the given
Scope, only a reference to this object is transmitted, if this node is already known by theScope. Otherwise, thecomplete objectdata is transmitted.- Parameters:
scope- The shared graphScopethat handles object references.out- The writer to write to.- Throws:
IOException
-
writeData
Writes the complete data of this node including type and ID to the given writer.Note: This method should only be called from a
Scope'sScope.writeRefOrData(JsonWriter, SharedGraphNode)if a fresh ID was assigned.- Parameters:
scope- The shared graphScopethat handles object references.out- The writer to write to.id- The ID to use for this node.- Throws:
IOException
-
readFields
Reads all fields of this instance from the given input.- Parameters:
scope- The shared graphScopethat handles object references.in- The reader to take the input from.- Throws:
IOException
-
writeFieldValue
Writes a single value that is currently assigned to the field with the given name to the given writer.- Parameters:
scope- The shared graphScopethat handles object references.out- The writer to write to.field- The name of the field whose value should be written.- Throws:
IOException
-
readField
Reads the given field from the given input.- Parameters:
scope- The shared graphScopethat handles object references.in- The reader to take the value from.field- The name of the field whose value should be read.- Throws:
IOException
-
writeElement
Writes the given element value that is compatible with the repeated field with the given name to the given output.- Parameters:
scope- The shared graphScopethat handles object references.out- The writer to write to.field- The name of the field whose element should be written.element- The element value of the given field.- Throws:
IOException
-
readElement
Read an element of the repeated field with the given name.- Parameters:
scope- The shared graphScopethat handles object references.in- The reader to take the value from.field- The repeated field where an element value should be read for.- Returns:
- The read element value.
- Throws:
IOException
-