Class that wraps a value and gives the utility of registering listeners that will be called after any variable value change.
- Parameters
-
<T> | the type of the observed value |
Definition at line 17 of file ObservedValue.java.
void writeObject |
( |
ObjectOutputStream |
out | ) |
throws IOException |
|
private |
The writeObject
method is responsible for writing the state of the object for its particular class so that the corresponding readObject
method can restore it.
It may call the default mechanism for saving the Object's fields calling out.defaultWriteObject
.
The method does not need to concern itself with the state belonging to its superclasses or subclasses. State is saved by writing the individual fields to the ObjectOutputStream
using the writeObject
method or by using the methods for primitive data types supported by DataOutput
.
- Parameters
-
out | writes primitive data types and graphs of Java objects to an OutputStream |
- Exceptions
-
IOException | thrown when an I/O exception of some sort has occurred |
- See also
- Serializable
-
ObjectOutputStream
Definition at line 115 of file ObservedValue.java.
void readObject |
( |
ObjectInputStream |
in | ) |
throws IOException, ClassNotFoundException |
|
private |
The readObject
method is responsible for reading from the stream and restoring the classes fields.
It may call in.defaultReadObject
to invoke the default mechanism for restoring the object's non-static and non-transient fields
The defaultReadObject
method uses information in the stream to assign the fields of the object saved in the stream with the correspondingly named fields in the current object.
This method handles the cast when the class has evolved to add new fields. The method does not need to concern itself with the state belonging to its superclasses or subclasses. State is saved by writing the individual fields to the ObjectOutputStream
using the writeObject
method or by using the methods for primitive data types supported by DataOutput
.
- Parameters
-
in | the ObjectInputStream that deserializes primitive data and objects previously written using an ObjectOutputStream |
- Exceptions
-
IOException | thrown when an I/O exception of some sort has occurred |
ClassNotFoundException | thrown when an application does not found a definition for the class with the specified name |
- See also
- Serializable
-
ObjectInputStream
Definition at line 145 of file ObservedValue.java.