Author(s): Jesús Correas.
This module defines a low level Prolog to Java interface.
javart
):- use_module(library(javart)).
java_create_object/2
,
java_delete_object/1
,
java_invoke_method/2
,
java_get_value/2
,
java_set_value/2
,
java_connection/0
,
java_remote_connection/1
,
java_disconnection/0
,
java_add_listener/3
,
java_remove_listener/3
.
machine_name/1
,
java_constructor/1
,
java_object/1
,
java_method/1
,
java_field/1
,
java_event/1
,
prolog_predicate/1
.
javart
)
Usage: java_create_object(+java_constructor,-(java_object))
+java_constructor
is a java constructor (structure with functor as constructor name (full package specification), and arguments as constructor ones).
(javart:java_constructor/1
)
-(java_object)
is a java object (structure with functor '$java_object', and argument an integer given by java side).
(javart:java_object/1
)
Usage: machine_name(X)
X
is the Internet name of a machine.
basic_props:regtype/1
)
Usage: java_constructor(X)
X
is a java constructor (structure with functor as constructor name (full package specification), and arguments as constructor ones).
basic_props:regtype/1
)
Usage: java_object(X)
X
is a java object (structure with functor '$java_object', and argument an integer given by java side).
basic_props:regtype/1
)
Usage: java_delete_object(+java_object)
+java_object
is a java object (structure with functor '$java_object', and argument an integer given by java side).
(javart:java_object/1
)
Usage: java_invoke_method(+java_object,+java_method)
+java_object
is a java object (structure with functor '$java_object', and argument an integer given by java side).
(javart:java_object/1
)
+java_method
is a java method (structure with functor as method name, and arguments as method ones, plus a result argument. This result argument is unified with the atom 'Yes' if the java method returns void).
(javart:java_method/1
)
Usage: java_method(X)
X
is a java method (structure with functor as method name, and arguments as method ones, plus a result argument. This result argument is unified with the atom 'Yes' if the java method returns void).
basic_props:regtype/1
)
Usage: java_get_value(+java_object,+java_field)
+java_object
is a java object (structure with functor '$java_object', and argument an integer given by java side).
(javart:java_object/1
)
+java_field
is a java field (structure with functor as field name, and argument as value).
(javart:java_field/1
)
Usage: java_set_value(+java_object,+java_field)
+java_object
is a java object (structure with functor '$java_object', and argument an integer given by java side).
(javart:java_object/1
)
+java_field
is a java field (structure with functor as field name, and argument as value).
(javart:java_field/1
)
Usage: java_field(X)
X
is a java field (structure with functor as field name, and argument as value).
basic_props:regtype/1
)
Usage:
Usage: java_remote_connection(+machine_name)
Usage:
Meta-predicate with arguments: java_add_listener(?,?,goal)
.
Usage: java_add_listener(+java_object,+java_event,+prolog_predicate)
+java_object
is a java object (structure with functor '$java_object', and argument an integer given by java side).
(javart:java_object/1
)
+java_event
is a java event represented as an atom with the basic event constructor name (e.g., 'java.awt.event.ActionListener').
(javart:java_event/1
)
+prolog_predicate
is a prolog predicate. Prolog term that represents the predicate that must be invoked when the event raises on the object. The predicate arguments can be java objects, or even the result of java methods. These java objects will be evaluated when the event raises (instead of when the listener is added). The arguments that represent java objects must be instantiated to already created objects. The variables will be kept uninstantiated when the event raises and the predicate will be called.
(javart:prolog_predicate/1
)
Usage: java_event(X)
X
is a java event represented as an atom with the basic event constructor name (e.g., 'java.awt.event.ActionListener').
basic_props:regtype/1
)
Usage: prolog_predicate(X)
X
is a prolog predicate. Prolog term that represents the predicate that must be invoked when the event raises on the object. The predicate arguments can be java objects, or even the result of java methods. These java objects will be evaluated when the event raises (instead of when the listener is added). The arguments that represent java objects must be instantiated to already created objects. The variables will be kept uninstantiated when the event raises and the predicate will be called.
basic_props:regtype/1
)
Usage: java_remove_listener(+java_object,+java_event,+prolog_predicate)
+java_object
is a java object (structure with functor '$java_object', and argument an integer given by java side).
(javart:java_object/1
)
+java_event
is a java event represented as an atom with the basic event constructor name (e.g., 'java.awt.event.ActionListener').
(javart:java_event/1
)
+prolog_predicate
is a prolog predicate. Prolog term that represents the predicate that must be invoked when the event raises on the object. The predicate arguments can be java objects, or even the result of java methods. These java objects will be evaluated when the event raises (instead of when the listener is added). The arguments that represent java objects must be instantiated to already created objects. The variables will be kept uninstantiated when the event raises and the predicate will be called.
(javart:prolog_predicate/1
)
Go to the first, previous, next, last section, table of contents.