jpl::JRef Class Reference

Inheritance diagram for jpl::JRef:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Term arg (int ano)
Term[] args ()
String debugString ()
final boolean equals (Object obj)
boolean hasFunctor (double value, int arity)
boolean hasFunctor (int value, int arity)
boolean hasFunctor (String name, int arity)
 JRef (Object ref)
Object jrefToObject ()
Object ref ()
String toString ()
final int type ()
String typeName ()

Protected Member Functions

final void getSubst (Map varnames_to_Terms, Map vars_to_Vars)
final void put (Map varnames_to_vars, term_t term)

Protected Attributes

final Object ref

Detailed Description

JRef is a specialised Term with an Object field, representing JPL's Prolog references to Java objects (or to null).

 JRef r = new JRef( non_String_object_or_null );
 

A JRef can be used (and re-used) in Compound Terms.


Copyright (C) 2004 Paul Singleton

Copyright (C) 1998 Fred Dushin

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library Public License for more details.


Author:
Fred Dushin <fadushin@syr.edu>
Version:
$Revision$
See also:
jpl.Term
jpl.Compound
Deprecated:

Definition at line 64 of file JRef.java.


Constructor & Destructor Documentation

jpl::JRef::JRef ( Object  ref  )  [inline]

This constructor creates a JRef, initialized with the supplied non-String object (or null).

Parameters:
ref this JRef's value (a non-String object, or null)

Definition at line 85 of file JRef.java.


Member Function Documentation

Term jpl::JRef::arg ( int  ano  )  [inline, virtual]

returns the ano-th (1+) argument of a (Compound) Term throws a JPLException for any other subclass

Returns:
the ano-th argument of a (Compound) Term

Implements jpl::Term.

Definition at line 97 of file JRef.java.

Term [] jpl::JRef::args (  )  [inline, virtual]

The (nonexistent) args of this JRef

Returns:
the (nonexistent) args of this JRef
Deprecated:

Implements jpl::Term.

Definition at line 151 of file JRef.java.

String jpl::JRef::debugString (  )  [inline, virtual]

Returns a debug-friendly representation of this JRef

Returns:
a debug-friendly representation of this JRef
Deprecated:

Implements jpl::Term.

Definition at line 162 of file JRef.java.

final boolean jpl::JRef::equals ( Object  obj  )  [inline]

Two JRefs are equal if their references are identical (?)

Parameters:
obj The Object to compare
Returns:
true if the Object satisfies the above condition

Definition at line 116 of file JRef.java.

final void jpl::JRef::getSubst ( Map  varnames_to_Terms,
Map  vars_to_Vars 
) [inline, protected, virtual]

Nothing needs to be done if the Term is an Atom, Integer, Float or JRef

Parameters:
varnames_to_Terms A Map from variable names to Terms.
vars_to_Vars A Map from Prolog variables to JPL Variables.

Implements jpl::Term.

Definition at line 194 of file JRef.java.

boolean jpl::JRef::hasFunctor ( double  value,
int  arity 
) [inline, virtual]

Tests whether this Term's functor has (double) 'name' and 'arity' Returns false if called inappropriately

Returns:
whether this Term's functor has (double) 'name' and 'arity'

Implements jpl::Term.

Definition at line 205 of file JRef.java.

boolean jpl::JRef::hasFunctor ( int  value,
int  arity 
) [inline, virtual]

Tests whether this Term's functor has (int) 'name' and 'arity' Returns false if called inappropriately

Returns:
whether this Term's functor has (int) 'name' and 'arity'

Implements jpl::Term.

Definition at line 201 of file JRef.java.

boolean jpl::JRef::hasFunctor ( String  name,
int  arity 
) [inline, virtual]

Tests whether this Term's functor has (String) 'name' and 'arity' Returns false if called inappropriately

Returns:
whether this Term's functor has (String) 'name' and 'arity'

Implements jpl::Term.

Definition at line 197 of file JRef.java.

Object jpl::JRef::jrefToObject (  )  [inline, virtual]

Implements jpl::Term.

Definition at line 209 of file JRef.java.

final void jpl::JRef::put ( Map  varnames_to_vars,
term_t  term 
) [inline, protected, virtual]

To convert a JRef to a term, we put its Object field (.value) into the term_t as a JPL ref (i.e. @/1) structure.

Parameters:
varnames_to_vars A Map from variable names to Prolog variables.
term A (newly created) term_t which is to be set to a Prolog 'ref' (i.e. @/1) structure denoting the .value of this JRef instance

Implements jpl::Term.

Definition at line 179 of file JRef.java.

Object jpl::JRef::ref (  )  [inline]

The non-String object (or null) which this jpl.JRef represents

Returns:
the non-String object (or null) which this jpl.JRef represents

Definition at line 137 of file JRef.java.

String jpl::JRef::toString (  )  [inline]

Returns a Prolog source text representation of this JRef

Returns:
a Prolog source text representation of this JRef

Definition at line 106 of file JRef.java.

final int jpl::JRef::type (  )  [inline, virtual]

returns the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc

Returns:
the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc

Implements jpl::Term.

Definition at line 120 of file JRef.java.

String jpl::JRef::typeName (  )  [inline, virtual]

returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc

Returns:
the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc

Implements jpl::Term.

Definition at line 124 of file JRef.java.


Member Data Documentation

final Object jpl::JRef::ref [protected]

the JRef's value (a non-String Object or null)

Definition at line 73 of file JRef.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines


jpl
Author(s): Lorenz Moesenlechner
autogenerated on Fri Jan 11 09:40:31 2013