All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.core.SerializedObject

java.lang.Object
   |
   +----weka.core.SerializedObject

public class SerializedObject
extends Object
implements Serializable
This class stores an object serialized in memory. It allows compression, to be used to conserve memory (for example, when storing large strings in memory), or can be used as a mechanism for deep copying objects.

Author:
Len Trigg (len@intelligenesis.net)

Constructor Index

 o SerializedObject(Object)
Serializes the supplied object into a byte array without compression.
 o SerializedObject(Object, boolean)
Serializes the supplied object into a byte array.

Method Index

 o equals(Object)
Compares this object with another for equality.
 o getObject()
Gets the object stored in this SerializedObject.
 o hashCode()
Returns a hashcode for this object.
 o main(String[])
Test routine, reads an arff file from stdin and measures memory usage (the arff file should have long string attribute values)
 o main2(String[])
Test routine, reads text from stdin and measures memory usage
 o toString()
Returns a text representation of the state of this object.

Constructors

 o SerializedObject
 public SerializedObject(Object obj) throws Exception
Serializes the supplied object into a byte array without compression.

Parameters:
obj - the Object to serialize.
Throws: Exception
if the object is not Serializable.
 o SerializedObject
 public SerializedObject(Object obj,
                         boolean compress) throws Exception
Serializes the supplied object into a byte array.

Parameters:
obj - the Object to serialize.
compress - true if the object should be stored compressed.
Throws: Exception
if the object is not Serializable.

Methods

 o getObject
 public Object getObject()
Gets the object stored in this SerializedObject. The object returned will be a deep copy of the original stored object.

Returns:
the deserialized Object.
 o equals
 public final boolean equals(Object other)
Compares this object with another for equality.

Parameters:
other - the other Object.
Returns:
true if the objects are equal.
Overrides:
equals in class Object
 o hashCode
 public final int hashCode()
Returns a hashcode for this object.

Returns:
the hashcode for this object.
Overrides:
hashCode in class Object
 o toString
 public String toString()
Returns a text representation of the state of this object.

Returns:
a String representing this object.
Overrides:
toString in class Object
 o main2
 public static void main2(String args[])
Test routine, reads text from stdin and measures memory usage

 o main
 public static void main(String args[])
Test routine, reads an arff file from stdin and measures memory usage (the arff file should have long string attribute values)


All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home