Package com.ericsson.otp.erlang
Class OtpErlangPid
- java.lang.Object
- 
- com.ericsson.otp.erlang.OtpErlangObject
- 
- com.ericsson.otp.erlang.OtpErlangPid
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable,- java.lang.Comparable<java.lang.Object>
 
 public class OtpErlangPid extends OtpErlangObject implements java.lang.Comparable<java.lang.Object> Provides a Java representation of Erlang PIDs. PIDs represent Erlang processes and consist of a nodename and a number of integers.- 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 Modifier Constructor Description protectedOtpErlangPid(int tag, java.lang.String node, int id, int serial, int creation)Create an Erlang pid from its components.OtpErlangPid(OtpInputStream buf)Create an Erlang PID from a stream containing a PID encoded in Erlang external format.OtpErlangPid(OtpLocalNode self)Deprecated.use OtpLocalNode:createPid() insteadOtpErlangPid(java.lang.String node, int id, int serial, int creation)Create an Erlang pid from its components.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object o)intcreation()Get the creation number from the PID.protected intdoHashCode()voidencode(OtpOutputStream buf)Convert this PID to the equivalent Erlang external representation.booleanequals(java.lang.Object o)Determine if two PIDs are equal.intid()Get the id number from the PID.java.lang.Stringnode()Get the node name from the PID.intserial()Get the serial number from the PID.protected inttag()java.lang.StringtoString()Get the string representation of the PID.
 
- 
- 
- 
Constructor Detail- 
OtpErlangPid@Deprecated public OtpErlangPid(OtpLocalNode self) Deprecated.use OtpLocalNode:createPid() insteadCreate a unique Erlang PID belonging to the local node.- Parameters:
- self- the local node.
 
 - 
OtpErlangPidpublic OtpErlangPid(OtpInputStream buf) throws OtpErlangDecodeException Create an Erlang PID from a stream containing a PID encoded in Erlang external format.- Parameters:
- buf- the stream containing the encoded PID.
- Throws:
- OtpErlangDecodeException- if the buffer does not contain a valid external representation of an Erlang PID.
 
 - 
OtpErlangPidpublic OtpErlangPid(java.lang.String node, int id, int serial, int creation)Create an Erlang pid from its components.- Parameters:
- node- the nodename.
- id- an arbitrary number. Only the low order 15 bits will be used.
- serial- another arbitrary number. Only the low order 13 bits will be used.
- creation- node incarnation number. Avoid values 0 to 3.
 
 - 
OtpErlangPidprotected OtpErlangPid(int tag, java.lang.String node, int id, int serial, int creation)Create an Erlang pid from its components.- Parameters:
- tag- the external format to be compliant with OtpExternal.pidTag where only a subset of the bits are significant (see other constructor). OtpExternal.newPidTag where all 32 bits of id,serial and creation are significant. newPidTag can only be decoded by OTP-19 and newer.
- node- the nodename.
- id- an arbitrary number.
- serial- another arbitrary number.
- creation- yet another arbitrary number.
 
 
- 
 - 
Method Detail- 
tagprotected int tag() 
 - 
serialpublic int serial() Get the serial number from the PID.- Returns:
- the serial number from the PID.
 
 - 
idpublic int id() Get the id number from the PID.- Returns:
- the id number from the PID.
 
 - 
creationpublic int creation() Get the creation number from the PID.- Returns:
- the creation number from the PID.
 
 - 
nodepublic java.lang.String node() Get the node name from the PID.- Returns:
- the node name from the PID.
 
 - 
toStringpublic java.lang.String toString() Get the string representation of the PID. Erlang PIDs are printed as #Pid<node.id.serial>- Specified by:
- toStringin class- OtpErlangObject
- Returns:
- the string representation of the PID.
 
 - 
encodepublic void encode(OtpOutputStream buf) Convert this PID to the equivalent Erlang external representation.- Specified by:
- encodein class- OtpErlangObject
- Parameters:
- buf- an output stream to which the encoded PID should be written.
 
 - 
equalspublic boolean equals(java.lang.Object o) Determine if two PIDs are equal. PIDs are equal if their components are equal.- Specified by:
- equalsin class- OtpErlangObject
- Parameters:
- o- the other PID to compare to.
- Returns:
- true if the PIDs are equal, false otherwise.
 
 - 
doHashCodeprotected int doHashCode() - Overrides:
- doHashCodein class- OtpErlangObject
 
 - 
compareTopublic int compareTo(java.lang.Object o) - Specified by:
- compareToin interface- java.lang.Comparable<java.lang.Object>
 
 
- 
 
-