All Packages Class Hierarchy This Package Previous Next Index
Interface sdsu.util.Stringizable
- public interface Stringizable
An interface for objects that can convert itself to a string and "recreate" itself from
that string. This interface is much more limited than Serializable. The few advantages
Stringizable has over Serializable are: Stringizable works with Java 1.0.2,
the string version of an object is readable and parsable by humans, and the
string version of an object is ligher weight than in Serializable. The main use
of Stringizable is for use in Java 1.0.2, motivate for students
the utility of Serializable with less overhead, and for use in client-server
programing where the strings must satisfy a protocol.
Version Info
1.1 Added metaData
- Version:
- 1.1 30 August 1997
- Author:
- Roger Whitney (whitney@cs.sdsu.edu)
- See Also:
- Stringizer, SimpleTokenizer, TokenCharacters
-
fromString(String)
- Converts a string to an object.
-
getMetaData()
- Gets the meta data from the object.
-
setMetaData(LabeledData)
- Sets the meta data for the object.
-
toString()
- Converts the object to a string
-
toString(String)
- Converts the object to a string with given header information.
fromString
public abstract void fromString(String objectString) throws ConversionException
- Converts a string to an object. String must be created from object of same
Class you are trying to recreate.
- Throws: ConversionException
- If there is a problem converting to object.
setMetaData
public abstract void setMetaData(LabeledData metaData)
- Sets the meta data for the object. Each class can define the
the meaning of meta data. For example in the class LabeledData,
the meta data could be the characters used to separate
name-value pairs, while the data will be the name-value pairs themselves
Must contain the name-value pair "class=objectClassName"
getMetaData
public abstract LabeledData getMetaData()
- Gets the meta data from the object. See setMetaData.
toString
public abstract String toString()
- Converts the object to a string
- Overrides:
- toString in class Object
toString
public abstract String toString(String header)
- Converts the object to a string with given header information.
All Packages Class Hierarchy This Package Previous Next Index