|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ericsson.otp.erlang.OtpErlangObject | +--com.ericsson.otp.erlang.OtpErlangRef
Provides a Java representation of Erlang refs. There are two styles of Erlang refs, old style (one id value) and new style (array of id values). This class manages both types.
Constructor Summary | |
OtpErlangRef(OtpInputStream buf)
Create an Erlang ref from a stream containing a ref encoded in Erlang external format. |
|
OtpErlangRef(OtpLocalNode self)
Deprecated. use OtpLocalNode:createRef() instead |
|
OtpErlangRef(java.lang.String node,
int[] ids,
int creation)
Create a new style Erlang ref from its components. |
|
OtpErlangRef(java.lang.String node,
int id,
int creation)
Create an old style Erlang ref from its components. |
Method Summary | |
java.lang.Object |
clone()
|
int |
creation()
Get the creation number from the ref. |
void |
encode(OtpOutputStream buf)
Convert this ref to the equivalent Erlang external representation. |
boolean |
equals(java.lang.Object o)
Determine if two refs are equal. |
int |
id()
Get the id number from the ref. |
int[] |
ids()
Get the array of id numbers from the ref. |
boolean |
isNewRef()
Determine whether this is a new style ref. |
java.lang.String |
node()
Get the node name from the ref. |
java.lang.String |
toString()
Get the string representation of the ref. |
Methods inherited from class com.ericsson.otp.erlang.OtpErlangObject |
decode |
Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public OtpErlangRef(OtpLocalNode self)
self
- the local node.public OtpErlangRef(OtpInputStream buf) throws OtpErlangDecodeException
buf
- the stream containing the encoded ref.public OtpErlangRef(java.lang.String node, int id, int creation)
node
- the nodename.id
- an arbitrary number. Only the low order 18 bits will
be used.creation
- another arbitrary number. Only the low order
2 bits will be used.public OtpErlangRef(java.lang.String node, int[] ids, int creation)
node
- the nodename.ids
- an array of arbitrary numbers. Only the low order 18
bits of the first number will be used. If the array contains only
one number, an old style ref will be written instead. At most
three numbers will be read from the array.creation
- another arbitrary number. Only the low order
2 bits will be used.Method Detail |
public int id()
public int[] ids()
public boolean isNewRef()
public int creation()
public java.lang.String node()
public java.lang.String toString()
public void encode(OtpOutputStream buf)
buf
- an output stream to which the encoded ref should be
written.public boolean equals(java.lang.Object o)
o
- the other ref to compare to.public java.lang.Object clone()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |