term_t
Date: 2018-01-12

org.jpl7.fli

## Class term_t

- java.lang.Object
- - org.jpl7.fli.LongHolder
  - - org.jpl7.fli.term_t

-     public class term_t
      extends LongHolder

  A term_t is a simple class which mirrors the term_t type in the Prolog FLI. All it really does is hold a term reference, which is an internal representation of a term in the Prolog Engine.

  Copyright (C) 1998 Fred Dushin

  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `UNASSIGNED`

    - ### Fields inherited from class org.jpl7.fli.LongHolder

      `value`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `term_t()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Instances of term_ts are stored in Term objects (see jpl.Term), and these term_ts are in some cases stored in Hashtables.
    `static java.lang.String` | `toString(int n, term_t term0)` This static method converts a term_t, which is assumed to contain a reference to a *consecutive* list of term_t references to a String representation of a list of terms, in this case, a comma separated list.

    - ### Methods inherited from class org.jpl7.fli.LongHolder

      `equals`

    - ### Methods inherited from class java.lang.Object

      `getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### UNASSIGNED

          public static final long UNASSIGNED

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### term_t

          public term_t()

  - ### Method Detail

    - #### toString

          public static java.lang.String toString(int n,
                                                  term_t term0)

      This static method converts a term_t, which is assumed to contain a reference to a *consecutive* list of term_t references to a String representation of a list of terms, in this case, a comma separated list.
      Parameters:
        `n` - the number of consecutive term_ts
        `term0` - a term_t whose value is the 0th term_t.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Instances of term_ts are stored in Term objects (see jpl.Term), and these term_ts are in some cases stored in Hashtables. Supplying this predicate provides the right behavior in Hashtable lookup (see the rules for Hashtable lookup in java.util).

      Note. Two term_ts are *not* equal if their values have not been assigned. (Since Prolog FLI term_ts are unsigned values and the UNASSIGNED value is -1, this should work).

      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the Object to comapre.
      Returns:
        true if the supplied object is a term_t instances and the long values are the same