jpl::JRef Class Reference
List of all members.
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] |
Term [] jpl::JRef::args |
( |
|
) |
[inline, virtual] |
String jpl::JRef::debugString |
( |
|
) |
[inline, virtual] |
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] |
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.
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
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: