Class OtpErlangObject

java.lang.Object
com.ericsson.otp.erlang.OtpErlangObject
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
OtpErlangAtom, OtpErlangBitstr, OtpErlangDouble, OtpErlangExternalFun, OtpErlangFun, OtpErlangList, OtpErlangLong, OtpErlangMap, OtpErlangPid, OtpErlangPort, OtpErlangRef, OtpErlangString, OtpErlangTuple

public abstract class OtpErlangObject extends Object implements Serializable, Cloneable
Base class of the Erlang data type classes. This class is used to represent an arbitrary Erlang term.
See Also:
  • Field Details Link icon

    • hashCodeValue Link icon

      protected int hashCodeValue
  • Constructor Details Link icon

    • OtpErlangObject Link icon

      public OtpErlangObject()
  • Method Details Link icon

    • toString Link icon

      public abstract String toString()
      Overrides:
      toString in class 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 Link icon

      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 Link icon

      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 Link icon

      public abstract boolean equals(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 Object
      Parameters:
      o - the object to compare to.
      Returns:
      true if the objects are identical.
    • match Link icon

      public <T> boolean match(OtpErlangObject term, T binds)
      Perform match operation against given term.
      Parameters:
      term - the object to match
      binds - variable bindings
      Returns:
      true if match succeeded
    • bind Link icon

      public <T> OtpErlangObject bind(T binds) throws OtpErlangException
      Make new Erlang term replacing variables with the respective values from bindings argument(s).
      Parameters:
      binds - variable bindings
      Returns:
      new term
      Throws:
      OtpErlangException
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • doHashCode Link icon

      protected int doHashCode()
    • clone Link icon

      public Object clone()
      Overrides:
      clone in class Object