Public Member Functions | |
Term | arg (int ano) |
Term[] | args () |
final int | arity () |
String | debugString () |
final double | doubleValue () |
final boolean | equals (Object obj) |
final float | floatValue () |
boolean | hasFunctor (double value, int arity) |
boolean | hasFunctor (String name, int arity) |
final boolean | hasFunctor (int val, int arity) |
Integer (long value) | |
final int | intValue () |
Object | jrefToObject () |
final long | longValue () |
final String | name () |
String | toString () |
final int | type () |
String | typeName () |
final int | value () |
Protected Member Functions | |
final void | getSubst (Map varnames_to_Terms, Map vars_to_Vars) |
final void | put (Map varnames_to_vars, term_t term) |
Static Protected Member Functions | |
static Term | getTerm1 (Map vars_to_Vars, term_t term) |
Protected Attributes | |
final long | value |
Integer is a specialised Term with a long field, representing a Prolog integer value.
Integer i = new Integer(1024);
Once constructed, the value of an Integer instance cannot be altered. An Integer can be used (and re-used) as an argument of Compounds. Beware confusing jpl.Integer with java.lang.Integer.
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.
Definition at line 65 of file Integer.java.
jpl::Integer::Integer | ( | long | value | ) | [inline] |
value | This Integer's (long) value |
Definition at line 83 of file Integer.java.
Term jpl::Integer::arg | ( | int | ano | ) | [inline, virtual] |
The (nonexistent) ano-th arg of this Integer
Implements jpl::Term.
Definition at line 96 of file Integer.java.
Term [] jpl::Integer::args | ( | ) | [inline, virtual] |
The (nonexistent) args of this Integer
Implements jpl::Term.
Definition at line 105 of file Integer.java.
final int jpl::Integer::arity | ( | ) | [inline] |
Returns the arity (0) of this jpl.Integer (c.f. functor/3)
Reimplemented from jpl::Term.
Definition at line 151 of file Integer.java.
String jpl::Integer::debugString | ( | ) | [inline, virtual] |
Returns a debug-friendly representation of this Integer's value
Implements jpl::Term.
Definition at line 243 of file Integer.java.
final double jpl::Integer::doubleValue | ( | ) | [inline] |
Returns the value of this Integer converted to a double
Reimplemented from jpl::Term.
Definition at line 192 of file Integer.java.
final boolean jpl::Integer::equals | ( | Object | obj | ) | [inline] |
Two Integer instances are equal if they are the same object, or if their values are equal
obj | The Object to compare (not necessarily an Integer) |
Definition at line 219 of file Integer.java.
final float jpl::Integer::floatValue | ( | ) | [inline] |
Returns the value of this Integer converted to a float
Reimplemented from jpl::Term.
Definition at line 183 of file Integer.java.
final void jpl::Integer::getSubst | ( | Map | varnames_to_Terms, | |
Map | vars_to_Vars | |||
) | [inline, protected, virtual] |
Converts a Prolog term (known to be an integer) to a new Integer instance.
vars_to_Vars | A Map from Prolog variables to JPL Variables | |
term | The Prolog term (an integer) which is to be converted |
Reimplemented from jpl::Term.
Definition at line 273 of file Integer.java.
boolean jpl::Integer::hasFunctor | ( | double | value, | |
int | arity | |||
) | [inline, virtual] |
Tests whether this Integer's functor has (double) 'name' and 'arity' (c.f. functor/3)
Implements jpl::Term.
Definition at line 133 of file Integer.java.
boolean jpl::Integer::hasFunctor | ( | String | name, | |
int | arity | |||
) | [inline, virtual] |
Tests whether this Integer's functor has (String) 'name' and 'arity' (c.f. functor/3)
Implements jpl::Term.
Definition at line 124 of file Integer.java.
final boolean jpl::Integer::hasFunctor | ( | int | val, | |
int | arity | |||
) | [inline, virtual] |
Tests whether this Integer's functor has (int) 'name' and 'arity' (c.f. functor/3)
Implements jpl::Term.
Definition at line 115 of file Integer.java.
final int jpl::Integer::intValue | ( | ) | [inline] |
Returns the value of this Integer as an int if possible, else throws a JPLException
JPLException | if the value of this Integer is too great to be represented as a Java int |
Reimplemented from jpl::Term.
Definition at line 161 of file Integer.java.
Object jpl::Integer::jrefToObject | ( | ) | [inline, virtual] |
Implements jpl::Term.
Definition at line 293 of file Integer.java.
final long jpl::Integer::longValue | ( | ) | [inline] |
Returns the value of this Integer as a long
Reimplemented from jpl::Term.
Definition at line 174 of file Integer.java.
final String jpl::Integer::name | ( | ) | [inline] |
throws a JPLException (name() is defined only for Compound, Atom and Variable)
Reimplemented from jpl::Term.
Definition at line 142 of file Integer.java.
final void jpl::Integer::put | ( | Map | varnames_to_vars, | |
term_t | term | |||
) | [inline, protected, virtual] |
To convert an Integer into a Prolog term, we put its value into the term_t.
varnames_to_vars | A Map from variable names to Prolog variables. | |
term | A (previously created) term_t which is to be set to a Prolog integer |
Implements jpl::Term.
Definition at line 258 of file Integer.java.
String jpl::Integer::toString | ( | ) | [inline] |
Returns a Prolog source text representation of this Integer's value
Definition at line 209 of file Integer.java.
final int jpl::Integer::type | ( | ) | [inline, virtual] |
returns the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc
Implements jpl::Term.
Definition at line 196 of file Integer.java.
String jpl::Integer::typeName | ( | ) | [inline, virtual] |
returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc
Implements jpl::Term.
Definition at line 200 of file Integer.java.
final int jpl::Integer::value | ( | ) | [inline] |
Returns the int value of this jpl.Integer
Definition at line 233 of file Integer.java.
final long jpl::Integer::value [protected] |
the Integer's immutable long value
Definition at line 74 of file Integer.java.