Package com.ericsson.otp.erlang
Class OtpErlangPort
- java.lang.Object
- 
- com.ericsson.otp.erlang.OtpErlangObject
- 
- com.ericsson.otp.erlang.OtpErlangPort
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 
 public class OtpErlangPort extends OtpErlangObject Provides a Java representation of Erlang ports.- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.ericsson.otp.erlang.OtpErlangObjectOtpErlangObject.Hash
 
- 
 - 
Field Summary- 
Fields inherited from class com.ericsson.otp.erlang.OtpErlangObjecthashCodeValue
 
- 
 - 
Constructor SummaryConstructors Constructor Description OtpErlangPort(int tag, java.lang.String node, long id, int creation)Create an Erlang port from its components.OtpErlangPort(OtpInputStream buf)Create an Erlang port from a stream containing a port encoded in Erlang external format.OtpErlangPort(java.lang.String node, long id, int creation)Create an Erlang port from its components.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcreation()Get the creation number from the port.protected intdoHashCode()voidencode(OtpOutputStream buf)Convert this port to the equivalent Erlang external representation.booleanequals(java.lang.Object o)Determine if two ports are equal.longid()Get the id number from the port.java.lang.Stringnode()Get the node name from the port.protected inttag()java.lang.StringtoString()Get the string representation of the port.
 
- 
- 
- 
Constructor Detail- 
OtpErlangPortpublic OtpErlangPort(OtpInputStream buf) throws OtpErlangDecodeException Create an Erlang port from a stream containing a port encoded in Erlang external format.- Parameters:
- buf- the stream containing the encoded port.
- Throws:
- OtpErlangDecodeException- if the buffer does not contain a valid external representation of an Erlang port.
 
 - 
OtpErlangPortpublic OtpErlangPort(java.lang.String node, long id, int creation)Create an Erlang port from its components.- Parameters:
- node- the nodename.
- id- an arbitrary number. Only the low order 28 bits will be used.
- creation- node incarnation number. Avoid values 0 to 3.
 
 - 
OtpErlangPortpublic OtpErlangPort(int tag, java.lang.String node, long id, int creation)Create an Erlang port from its components.- Parameters:
- tag- the external format to be compliant with. OtpExternal.portTag where only a subset of the bits are used (see other constructor) OtpExternal.newPortTag where all 32 bits of id and creation are significant. newPortTag can only be decoded by OTP-19 and newer.
- node- the nodename.
- id- an arbitrary number. Only the low order 28 bits will be used.
- creation- another arbitrary number.
 
 
- 
 - 
Method Detail- 
tagprotected int tag() 
 - 
idpublic long id() Get the id number from the port.- Returns:
- the id number from the port.
 
 - 
creationpublic int creation() Get the creation number from the port.- Returns:
- the creation number from the port.
 
 - 
nodepublic java.lang.String node() Get the node name from the port.- Returns:
- the node name from the port.
 
 - 
toStringpublic java.lang.String toString() Get the string representation of the port. Erlang ports are printed as #Port<node.id>.- Specified by:
- toStringin class- OtpErlangObject
- Returns:
- the string representation of the port.
 
 - 
encodepublic void encode(OtpOutputStream buf) Convert this port to the equivalent Erlang external representation.- Specified by:
- encodein class- OtpErlangObject
- Parameters:
- buf- an output stream to which the encoded port should be written.
 
 - 
equalspublic boolean equals(java.lang.Object o) Determine if two ports are equal. Ports are equal if their components are equal.- Specified by:
- equalsin class- OtpErlangObject
- Parameters:
- o- the other port to compare to.
- Returns:
- true if the ports are equal, false otherwise.
 
 - 
doHashCodeprotected int doHashCode() - Overrides:
- doHashCodein class- OtpErlangObject
 
 
- 
 
-