<commit_before>:- op(50, xfx, returns).


/*load this after the driver logtalk file*/

:- category(java_bridge,
	implements(forwarding)).

	:- info([
		version is 1.0,
		author is '<NAME> and <NAME>',
		date is 2014/03/27,
		comment is 'Forward messages that are not understood by a Logtalk object to Java.']).

	:- public(returns/2).
	:- mode(returns(?term, -term), zero_or_one).
	:- info(returns/2, [
		comment is 'Delegate a message to a Java object and return the Java method return value.',
		argnames is ['Object::Message', 'ReturnValue']]).

	returns(Message, ReturnValue) :-
		self(Object),
		java(Object, ReturnValue)::invoke(Message).

	forward(Message) :-
		returns(Message, _ReturnValue).

:- end_category.<commit_msg>adding a jobject protected method in the java_bridge category answering the term representation of the receiver in the Java side<commit_after>:- op(50, xfx, returns).


/*load this after the driver logtalk file*/

:- category(java_bridge,
	implements(forwarding)).

	:- info([
		version is 1.0,
		author is '<NAME> and <NAME>',
		date is 2014/03/27,
		comment is 'Forward messages that are not understood by a Logtalk object to Java.']).

	:- public(returns/2).
	:- mode(returns(?term, -term), zero_or_one).
	:- info(returns/2, [
		comment is 'Delegate a message to a Java object and return the Java method return value.',
		argnames is ['Object::Message', 'ReturnValue']]).

	returns(Message, ReturnValue) :-
		jobject(Object),
		java(Object, ReturnValue)::invoke(Message).


	forward(Message) :-
		returns(Message, _ReturnValue).


	protected(jobject/1).
	:- mode(jobject(?term), one).
	:- info(jobject/1, [
		comment is 'The term representation of the receiver in the Java side.',
		argnames is ['JObject']]).

	jobject(JObject) :-
		self(JObject).
		
:- end_category.
{'fraction_non_alphanumeric': 0.14269850083287064, 'fraction_numerical': 0.01665741254858412, 'mean_word_length': 4.076056338028169, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7311729', 'n_tokens_mistral': 614, 'n_tokens_neox': 552, 'n_words': 185}