Package com.ericsson.otp.erlang
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
Base class of the Erlang data type classes. This class is used to represent
an arbitrary Erlang term.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> OtpErlangObject
bind
(T binds) Make new Erlang term replacing variables with the respective values from bindings argument(s).clone()
static OtpErlangObject
decode
(OtpInputStream buf) Read binary data in the Erlang external format, and produce a corresponding Erlang data type object.protected int
abstract void
encode
(OtpOutputStream buf) Convert the object according to the rules of the Erlang external format.abstract boolean
Determine if two Erlang objects are equal.int
hashCode()
<T> boolean
match
(OtpErlangObject term, T binds) Perform match operation against given term.abstract String
toString()
-
Field Details
-
hashCodeValue
protected int hashCodeValue
-
-
Constructor Details
-
OtpErlangObject
public OtpErlangObject()
-
-
Method Details
-
toString
-
encode
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
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
Determine if two Erlang objects are equal. In general, Erlang objects are equal if the components they consist of are equal. -
match
Perform match operation against given term.- Parameters:
term
- the object to matchbinds
- variable bindings- Returns:
- true if match succeeded
-
bind
Make new Erlang term replacing variables with the respective values from bindings argument(s).- Parameters:
binds
- variable bindings- Returns:
- new term
- Throws:
OtpErlangException
-
hashCode
public int hashCode() -
doHashCode
protected int doHashCode() -
clone
-