jpl::Float Class Reference

Inheritance diagram for jpl::Float:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

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) 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

Definition at line 66 of file Float.java.


Constructor & Destructor Documentation

jpl::Float::Float ( double  value  )  [inline]

This constructor creates a Float with the supplied (double) value.

Parameters:
value this Float's value

Definition at line 87 of file Float.java.


Member Function Documentation

final Term jpl::Float::arg ( int  i  )  [inline, virtual]

throws a JPLException (arg(int) is defined only for Compound and Atom)

Returns:
the ith argument (counting from 1) of this Float (never)

Implements jpl::Term.

Definition at line 100 of file Float.java.

Term [] jpl::Float::args (  )  [inline, virtual]

The (nonexistent) args of this Float

Returns:
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

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

Returns:
a debug-friendly String representation of this Float
Deprecated:

Implements jpl::Term.

Definition at line 245 of file Float.java.

final double jpl::Float::doubleValue (  )  [inline]

returns the (double) value of this Float

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

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

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

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]

Nothing needs to be done if the Term is an Atom, Integer or (as in this case) a Float

Parameters:
varnames_to_Terms A Map from variable names to JPL Terms
vars_to_Vars A Map from Prolog variables to JPL Variables

Implements jpl::Term.

Definition at line 293 of file Float.java.

static Term jpl::Float::getTerm1 ( Map  vars_to_Vars,
term_t  term 
) [inline, static, protected]

Converts a Prolog term (known to be a float) to a JPL Float.

Parameters:
vars_to_Vars A Map from Prolog variables to JPL Variables
term The Prolog term (a float) to convert
Returns:
A new Float instance

Reimplemented from jpl::Term.

Definition at line 276 of file Float.java.

final boolean jpl::Float::hasFunctor ( double  val,
int  arity 
) [inline, virtual]

Tests whether this Float's functor has (double) 'name' and 'arity'

Returns:
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)

Returns:
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)

Returns:
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

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

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)

Returns:
the name of this Float (never)

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.

Parameters:
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

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

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

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

Returns:
the Float's value
Deprecated:

Definition at line 235 of file Float.java.


Member Data Documentation

final double jpl::Float::value [protected]

the Float's immutable value

Definition at line 75 of file Float.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines


jpl
Author(s): Lorenz Moesenlechner
autogenerated on Fri Jan 11 09:40:31 2013