jiface.erlang.types

atom

(atom arg)

Constructor for an Erlang atom data type. arg may be any of the following:

  • a java.lang.String
  • a boolean
  • an OtpInputStream (buffer)

binary

(binary arg)

Constructor for an Erlang binary data type where arg can be any of the following:

  • a byte array,
  • an arbitrary Java Object
  • an OtpInputStream (buffer)

bitstr

(bitstr arg)(bitstr byte-array pad-bits)

Constructor for an Erlang bitstring data type. It may take either one or two arguments. If one is passed, they be of the following types:

  • a byte array,
  • an arbitrary Java Object
  • an OtpInputStream (buffer)

If two are passed, the first must be a byte array and the second must be an integer representing the pad bits.

boolean

(boolean arg)

Constructor for an Erlang boolean (atom) data type. arg may be either of the following:

  • a boolean
  • an OtpInputStream (buffer)

byte

(byte arg)

See the docstring for #'types/long. arg may be either of the following:

  • a byte
  • an OtpInputStream (buffer)

Note that Erlang itself does not distringuish integer types, however JInterface provides a means of mapping between Java integer types and Erlang with the following classes:

  • OtpErlangByte
  • OtpErlangChar
  • OtpErlangInt
  • OtpErlangLong
  • OtpErlangShort
  • OtpErlangUInt
  • OtpErlangUShort

As such, jiface supplies the following constructors:

  • types/byte
  • types/char
  • types/int
  • types/long
  • types/short
  • types/uint
  • types/ushort

OtpErlangUInt and OtpErlangUShort (and thus types/unit and types/ushort) are provided for Corba compatibility.

char

(char num)

See the docstring for #'types/long. arg may be either of the following:

  • a char
  • an OtpInputStream (buffer)

Note that Erlang itself does not distringuish integer types, however JInterface provides a means of mapping between Java integer types and Erlang with the following classes:

  • OtpErlangByte
  • OtpErlangChar
  • OtpErlangInt
  • OtpErlangLong
  • OtpErlangShort
  • OtpErlangUInt
  • OtpErlangUShort

As such, jiface supplies the following constructors:

  • types/byte
  • types/char
  • types/int
  • types/long
  • types/short
  • types/uint
  • types/ushort

OtpErlangUInt and OtpErlangUShort (and thus types/unit and types/ushort) are provided for Corba compatibility.

double

(double num)

Provides a Java representation of Erlang double. arg may be either of the following:

  • a double
  • an OtpInputStream (buffer)

external-fun

(external-fun buf)(external-fun mod func arity)

Erlang external function representation. If a single argument is passed, it must be an OtpInputStream. If three arguments are passed, they must be:

  • the module (String)
  • the function (String)
  • the function’s arity (Integer).

float

(float num)

Provides a Java representation of Erlang float. arg may be either of the following:

  • a float
  • an OtpInputStream (buffer)

fun

(fun buf)(fun pid module index uniq free-vars)(fun pid module arity md5 index old-index uniq free-vars)

Erlang internal function representation. If a single argument is passed, it must be an OtpInputStream. If five arguments are passed, they must be:

  • an OtpErlangPid
  • a module (String)
  • an index (Long)
  • uniq (Long)
  • an array of OtpErlangObjects

If eight arguments are passed, they must be:

  • an OtpErlangPid
  • a module (String)
  • function arity (Integer)
  • an md5 as an array of bytes
  • an index (Integer)
  • an old index (Long)
  • uniq (Long)
  • an array of OtpErlangObjects

int

(int arg)

Provides a Java representation of an Erlang integer. arg may be either of the following:

  • an Integer
  • an OtpInputStream (buffer)

Note that Erlang itself does not distringuish integer types, however JInterface provides a means of mapping between Java integer types and Erlang with the following classes:

  • OtpErlangByte
  • OtpErlangChar
  • OtpErlangInt
  • OtpErlangLong
  • OtpErlangShort
  • OtpErlangUInt
  • OtpErlangUShort

As such, jiface supplies the following constructors:

  • types/byte
  • types/char
  • types/int
  • types/long
  • types/short
  • types/uint
  • types/ushort

OtpErlangUInt and OtpErlangUShort (and thus types/unit and types/ushort) are provided for Corba compatibility.

list

(list)(list args)(list elems last-tail)(list elems index count)

Provides a Java representation of Erlang lists. Lists are created from zero or more arbitrary Erlang terms. If no argument is provided, an empty list is returned. If one argument is provided, it may be one of the following types:

  • an OtpErlangObject (a single-item list will be returned)
  • an array of OtpErlangObjects
  • a String (a list of Erlang integers will be returned, repsresenting Uncode code points
  • an OtpInputStream (buffer)

If two arguments are passed, they must be of the following types:

  • an array of OtpErlangObjects
  • a last tail OtpErlangObject

If three arguments are passed, a new list will be created from a subset of the passed list, the arguments being:

  • an array of OtpErlangObjects
  • a starting index (Integer)
  • the number of items to include (Integer), starting with the element at the given index

The arity of the list is the number of elements it contains.

long

(long arg)

Provides a Java representation of an Erlang integer. arg may be one of the following:

  • a long
  • a java.math.BigInteger
  • an OtpInputStream (buffer)

Note that Erlang itself does not distringuish integer types, however JInterface provides a means of mapping between Java integer types and Erlang with the following classes:

  • OtpErlangByte
  • OtpErlangChar
  • OtpErlangInt
  • OtpErlangLong
  • OtpErlangShort
  • OtpErlangUInt
  • OtpErlangUShort

As such, jiface supplies the following constructors:

  • types/byte
  • types/char
  • types/int
  • types/long
  • types/short
  • types/uint
  • types/ushort

OtpErlangUInt and OtpErlangUShort (and thus types/unit and types/ushort) are provided for Corba compatibility.

map

(map)(map buf)(map ks vs)(map ks kstart kcount vs vstart vcount)

Provides a Java representation of Erlang maps. Maps are created from one or more arbitrary Erlang terms. If no argument is provided, an empty map is returned. If a sing argument is provided, it must be of type OtpInputStream. If two arguments are passed, they must be:

  • an array of OtpErlangObjects representing the map keys
  • an array of OtpErlangObjects representing the corresponding map values

Alternatively, a “sub-map” may be created by providing six arguments:

  • an array of OtpErlangObjects representing the map keys
  • the starting index of the map keys (Integer)
  • the number of keys to include (Integer), starting with the element at the given index
  • an array of OtpErlangObjects representing the corresponding map values
  • the starting index of the map values (Integer)
  • the number of values to include (Integer), starting with the element at the given index

The arity of the map is the number of elements it contains. The keys and values can be retrieved as arrays and the value for a key can be queried.

object

(object)

This is a psuedo-constructor: OtpErlangObject doesn’t provide a constructor method, but the object itself is needed for creating tuples, so this function simply returns OtpErlangObject.

pid

(pid buf)(pid node id serial creation)

Provides a Java representation of an Erlang PID. PIDs represent Erlang processes and consist of a nodename and a number of integers.

If one argument is passed, it must be of type OtpInputStream. If four arguments are passed, they must be:

  • the node (String)
  • the pid number (Integer)
  • the pid serial (Integer)
  • the pid creation (Integer)

port

(port buf)(port node id creation)(port tag node id creation)

Provides a Java representation of an Erlang Port.

If one argument is passed, it must be of type OtpInputStream. If three arguments are passed, they must be:

  • the node (String)
  • the port id (Integer)
  • the pid creation (Integer)

If four arguments are passed, they must be:

  • the tag (Integer)
  • the node (String)
  • the port id (Integer)
  • the port creation (Integer)

ref

(ref buf)(ref node ids creation)(ref tag node ids creation)

Provides a Java representation of an Erlang ref.

If one argument is passed, it must be of type OtpInputStream. If three arguments are passed, they must be:

  • the node (String)
  • an array of Integers
  • the ref creation (Integer)

If four arguments are passed, they must be:

  • the tag (Integer)
  • the node (String)
  • an array of Integers
  • the pid creation (Integer)

short

(short arg)

Provides a Java representation of an Erlang integer. arg may be either of the following:

  • a short
  • an OtpInputStream (buffer)

Note that Erlang itself does not distringuish integer types, however JInterface provides a means of mapping between Java integer types and Erlang with the following classes:

  • OtpErlangByte
  • OtpErlangChar
  • OtpErlangInt
  • OtpErlangLong
  • OtpErlangShort
  • OtpErlangUInt
  • OtpErlangUShort

As such, jiface supplies the following constructors:

  • types/byte
  • types/char
  • types/int
  • types/long
  • types/short
  • types/uint
  • types/ushort

OtpErlangUInt and OtpErlangUShort (and thus types/unit and types/ushort) are provided for Corba compatibility.

string

(string arg)

Provides a Java representation of Erlang strings. Supplied argument may be any of:

  • String
  • OtpErlangList
  • OtpInputStream (buffer)

tuple

(tuple arg)(tuple array index count)

Provides a Java representation of Erlang tuples. Tuples are created from one or more arbitrary Erlang terms. If a single argument is passed, it may be: * an OtpErlangObject, in which case a unary tuple will be created * an array of OtpErlangObjects, in which case the tuple will have the same arity as the array that is passed * an OtpInputStream (buffer)

Alternatively, a tuple may be created from a subset of an array of OtpErlangObjects by passing the array, the starting index (0-based), and the count (number of elements to include).

The arity of the tuple is the number of elements it contains. Elements are indexed from 0 to (arity-1) and can be retrieved individually by using the appropriate index.

uint

(uint arg)

See the docstring for #'types/int.

ushort

(ushort arg)

See the docstring for #'types/short.