sexp
Class BaseSexp

java.lang.Object
  |
  +--sexp.BaseSexp
Direct Known Subclasses:
Sexp, SList

public abstract class BaseSexp
extends Object
implements SExpression

This class is a base implementation of the SExpression interface. It mostly deals with converting the extending class to the various representations (canonical, transport and advanced). Unfortunately the exceptions thrown are RuntimeExceptions, not IOExceptions as they really should be. This both will and must change!

Version:
$Id: BaseSexp.java,v 1.2 2001/10/05 22:02:25 tep Exp $
Author:
Per Harald Myrvang <perm@pasta.cs.uit.no>
See Also:
SExpression, SList, Sexp

Field Summary
protected static String __me
           
 
Fields inherited from interface sexp.SExpression
versionString
 
Constructor Summary
BaseSexp()
           
 
Method Summary
 byte[] toAdvanced()
          Returns this S-Expression as a byte array, where the components are represented in their Advanced representation (that is, pretty-printed).
 void toAdvanced(OutputStream out)
          Writes this S-Expression to an OutputStream.
 byte[] toCanonical()
          Returns this S-Expression as a byte array.
 void toCanonical(OutputStream out)
          Write this S-Expression to an OutputStream.
 String toString()
          Returns this S-Expression in its Advanced representation, as a String.
 byte[] toTransport()
          Returns this S-Expression as a byte array, in transport representation.
 void toTransport(OutputStream out)
          Write this S-Expression to an OutputStream.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

__me

protected static String __me
Constructor Detail

BaseSexp

public BaseSexp()
Method Detail

toCanonical

public byte[] toCanonical()
Returns this S-Expression as a byte array. The components are represented in their canonical representation.
Specified by:
toCanonical in interface SExpression
Throws:
RuntimeException - when something goes haywire

toCanonical

public void toCanonical(OutputStream out)
Write this S-Expression to an OutputStream. The components are represented in their canonical representation.
Specified by:
toCanonical in interface SExpression
Throws:
RuntimeException - when something goes haywire

toTransport

public byte[] toTransport()
Returns this S-Expression as a byte array, in transport representation.
Specified by:
toTransport in interface SExpression
Throws:
RuntimeException - when something goes haywire

toTransport

public void toTransport(OutputStream out)
Write this S-Expression to an OutputStream. The components are represented in transport representation.
Specified by:
toTransport in interface SExpression
Throws:
RuntimeException - when something goes haywire

toString

public String toString()
Returns this S-Expression in its Advanced representation, as a String.
Specified by:
toString in interface SExpression
Overrides:
toString in class Object
Throws:
RuntimeException - when something goes haywire

toAdvanced

public byte[] toAdvanced()
Returns this S-Expression as a byte array, where the components are represented in their Advanced representation (that is, pretty-printed).
Specified by:
toAdvanced in interface SExpression
Throws:
RuntimeException - when something goes haywire

toAdvanced

public void toAdvanced(OutputStream out)
Writes this S-Expression to an OutputStream. The components are represented in transport representation.
Specified by:
toAdvanced in interface SExpression
Throws:
RuntimeException - when something goes haywire