com.ericsson.otp.erlang
Class OtpErlangObject

java.lang.Object
  |
  +--com.ericsson.otp.erlang.OtpErlangObject
Direct Known Subclasses:
OtpErlangAtom, OtpErlangBinary, OtpErlangDouble, OtpErlangList, OtpErlangLong, OtpErlangPid, OtpErlangPort, OtpErlangRef, OtpErlangString, OtpErlangTuple

public abstract class OtpErlangObject
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Base class of the Erlang data type classes. This class is used to represent an arbitrary Erlang term.

See Also:
Serialized Form

Constructor Summary
OtpErlangObject()
           
 
Method Summary
 java.lang.Object clone()
           
static OtpErlangObject decode(OtpInputStream buf)
          Read binary data in the Erlang external format, and produce a corresponding Erlang data type object.
abstract  void encode(OtpOutputStream buf)
          Convert the object according to the rules of the Erlang external format.
abstract  boolean equals(java.lang.Object o)
          Determine if two Erlang objects are equal.
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OtpErlangObject

public OtpErlangObject()
Method Detail

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the printable representation of the object. This is usually similar to the representation used by Erlang for the same type of object.

encode

public abstract void encode(OtpOutputStream buf)
Convert the object according to the rules of the Erlang external format. This is mainly used for sending Erlang terms in messages, however it can also be used for storing terms to disk.
Parameters:
buf - an output stream to which the encoded term should be written.

decode

public static OtpErlangObject decode(OtpInputStream buf)
                              throws OtpErlangDecodeException
Read binary data in the Erlang external format, and produce a corresponding Erlang data type object. This method is normally used when Erlang terms are received in messages, however it can also be used for reading terms from disk.
Parameters:
buf - an input stream containing one or more encoded Erlang terms.
Returns:
an object representing one of the Erlang data types.
Throws:
OtpErlangDecodeException - if the stream does not contain a valid representation of an Erlang term.

equals

public abstract boolean equals(java.lang.Object o)
Determine if two Erlang objects are equal. In general, Erlang objects are equal if the components they consist of are equal.
Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare to.
Returns:
true if the objects are identical.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object