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.

Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
Stringizer, SimpleTokenizer, TokenCharacters

Method Index

 o fromString(String)
Converts a string to an object.
 o setSeparatorChar(char)
Set character used to separate elements in String representation of object
 o setTokenCharacters(TokenCharacters)
Sets TokenCharacters used to convert object from/to strings/streams.
 o toString()
Converts the object to a string
 o toString(String)
Converts the object to a string with given header information.

Methods

 o 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.
 o toString
 public abstract String toString()
Converts the object to a string

Overrides:
toString in class Object
 o toString
 public abstract String toString(String header)
Converts the object to a string with given header information.

 o setSeparatorChar
 public abstract void setSeparatorChar(char separatorChar)
Set character used to separate elements in String representation of object

 o setTokenCharacters
 public abstract void setTokenCharacters(TokenCharacters newParseTable)
Sets TokenCharacters used to convert object from/to strings/streams. Current values for separatorChar override separator settings in TokenCharacters object.


All Packages  Class Hierarchy  This Package  Previous  Next  Index