Public Member Functions | |
final Term | arg (int i) |
Term[] | args () |
final int | arity () |
String | debugString () |
final double | doubleValue () |
final boolean | equals (Object obj) |
Float (double value) | |
final float | floatValue () |
final boolean | hasFunctor (double val, int arity) |
final boolean | hasFunctor (int val, int arity) |
final boolean | hasFunctor (String name, int arity) |
final int | intValue () |
Object | jrefToObject () |
final long | longValue () |
final String | name () |
String | toString () |
final int | type () |
String | typeName () |
double | 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 double | value |
Float is a specialised Term with a double field, representing a Prolog 64-bit ISO/IEC floating point value. Once constructed, a Float's value cannot be altered.
Float f = new Float( 3.14159265 );
A Float can be used (and re-used) in Compound Terms. Two Float instances are equal (by .equals()) iff their (double) values are equal.
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 66 of file Float.java.
jpl::Float::Float | ( | double | value | ) | [inline] |
This constructor creates a Float with the supplied (double) value.
value | this Float's value |
Definition at line 87 of file Float.java.
final Term jpl::Float::arg | ( | int | i | ) | [inline, virtual] |
throws a JPLException (arg(int) is defined only for Compound and Atom)
Implements jpl::Term.
Definition at line 100 of file Float.java.
Term [] jpl::Float::args | ( | ) | [inline, virtual] |
The (nonexistent) args of this Float
Implements jpl::Term.
Definition at line 109 of file Float.java.
final int jpl::Float::arity | ( | ) | [inline] |
Returns the arity (0) of this Float
Reimplemented from jpl::Term.
Definition at line 154 of file Float.java.
String jpl::Float::debugString | ( | ) | [inline, virtual] |
Returns a debug-friendly String representation of this Float
Implements jpl::Term.
Definition at line 245 of file Float.java.
final double jpl::Float::doubleValue | ( | ) | [inline] |
returns the (double) value of this Float
Reimplemented from jpl::Term.
Definition at line 190 of file Float.java.
final boolean jpl::Float::equals | ( | Object | obj | ) | [inline] |
Two Floats are equal if they are the same object, or their values are equal
obj | The Object to compare |
Definition at line 217 of file Float.java.
final float jpl::Float::floatValue | ( | ) | [inline] |
returns the (double) value of this Float, converted to a float
Reimplemented from jpl::Term.
Definition at line 181 of file Float.java.
final void jpl::Float::getSubst | ( | Map | varnames_to_Terms, | |
Map | vars_to_Vars | |||
) | [inline, protected, virtual] |
final boolean jpl::Float::hasFunctor | ( | double | val, | |
int | arity | |||
) | [inline, virtual] |
Tests whether this Float's functor has (double) 'name' and 'arity'
Implements jpl::Term.
Definition at line 136 of file Float.java.
final boolean jpl::Float::hasFunctor | ( | int | val, | |
int | arity | |||
) | [inline, virtual] |
Tests whether this Float's functor has (int) 'name' and 'arity' (never)
Implements jpl::Term.
Definition at line 127 of file Float.java.
final boolean jpl::Float::hasFunctor | ( | String | name, | |
int | arity | |||
) | [inline, virtual] |
Tests whether this Float's functor has (String) 'name' and 'arity' (never)
Implements jpl::Term.
Definition at line 118 of file Float.java.
final int jpl::Float::intValue | ( | ) | [inline] |
returns the (double) value of this Float, converted to an int
Reimplemented from jpl::Term.
Definition at line 163 of file Float.java.
Object jpl::Float::jrefToObject | ( | ) | [inline, virtual] |
Implements jpl::Term.
Definition at line 221 of file Float.java.
final long jpl::Float::longValue | ( | ) | [inline] |
returns the (double) value of this Float, converted to a long
Reimplemented from jpl::Term.
Definition at line 172 of file Float.java.
final String jpl::Float::name | ( | ) | [inline] |
throws a JPLException (name() is defined only for Compound, Atom and Variable)
Reimplemented from jpl::Term.
Definition at line 145 of file Float.java.
final void jpl::Float::put | ( | Map | varnames_to_vars, | |
term_t | term | |||
) | [inline, protected, virtual] |
To convert a JPL Float to a Prolog term, we put its value field into the term_t as a float.
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 float corresponding to this Float's value |
Implements jpl::Term.
Definition at line 261 of file Float.java.
String jpl::Float::toString | ( | ) | [inline] |
Returns a Prolog source text representation of this Float
Definition at line 207 of file Float.java.
final int jpl::Float::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 194 of file Float.java.
String jpl::Float::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 198 of file Float.java.
double jpl::Float::value | ( | ) | [inline] |
The immutable value of this jpl.Float object, as a Java double
Definition at line 235 of file Float.java.
final double jpl::Float::value [protected] |
the Float's immutable value
Definition at line 75 of file Float.java.