Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jpl
Class JRef

    java.lang.Object
      jpl.Term
          jpl.JRef

public class JRef
extends Term

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.

Version:
  $Revision: 1.2 $
See Also:
  `Term`, `Compound`

Constructor Summary
`JRef(java.lang.Object ref)` This constructor creates a JRef, initialized with the supplied non-String object (or null).

Method Summary
`Term[]` | `args()` Deprecated.
`java.lang.String` | `debugString()` Deprecated.
`boolean` | `equals(java.lang.Object obj)` Two JRefs are equal if their references are identical (?)
`java.lang.Object` | `ref()` The non-String object (or null) which this jpl.JRef represents
`java.lang.String` | `toString()` Returns a Prolog source text representation of this JRef
`int` | `type()` returns the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc
`java.lang.String` | `typeName()` returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc

Methods inherited from class jpl.Term
`arg, arity, debugString, doubleValue, floatValue, hasFunctor, hasFunctor, hasFunctor, intValue, isAtom, isCompound, isFloat, isInteger, isJBoolean, isJRef, isJVoid, isVariable, listLength, longValue, name, putParams, putParams, toString, toTermArray`

Methods inherited from class java.lang.Object
`getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### JRef

    public JRef(java.lang.Object ref)

  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)

Method Detail

### toString

    public java.lang.String toString()

  Returns a Prolog source text representation of this JRef

  Returns:
    a Prolog source text representation of this JRef

### equals

    public final boolean equals(java.lang.Object obj)

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

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

### type

    public final int type()

  Description copied from class: `Term`
  returns the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc

  Specified by:
    `type` in class `Term`
  Returns:
    the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc

### typeName

    public java.lang.String typeName()

  Description copied from class: `Term`
  returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc

  Specified by:
    `typeName` in class `Term`
  Returns:
    the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc

### ref

    public java.lang.Object ref()

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

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

### args

    public Term[] args()

  Deprecated.

  The (nonexistent) args of this JRef

  Specified by:
    `args` in class `Term`
  Returns:
    the (nonexistent) args of this JRef

### debugString

    public java.lang.String debugString()

  Deprecated.

  Returns a debug-friendly representation of this JRef

  Specified by:
    `debugString` in class `Term`
  Returns:
    a debug-friendly representation of this JRef

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD