jpl::Integer Class Reference

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

List of all members.

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

Detailed Description

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) 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 65 of file Integer.java.


Constructor & Destructor Documentation

jpl::Integer::Integer ( long  value  )  [inline]
Parameters:
value This Integer's (long) value

Definition at line 83 of file Integer.java.


Member Function Documentation

Term jpl::Integer::arg ( int  ano  )  [inline, virtual]

The (nonexistent) ano-th arg of this Integer

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

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

Returns:
the arity (0) of this jpl.Integer

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

Returns:
a debug-friendly representation of this Integer's value
Deprecated:

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

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

Parameters:
obj The Object to compare (not necessarily an Integer)
Returns:
true if the Object satisfies the above condition

Definition at line 219 of file Integer.java.

final float jpl::Integer::floatValue (  )  [inline]

Returns the value of this Integer converted to a float

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]

Nothing needs to be done if the Term is an Atom, Integer or Float

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

Implements jpl::Term.

Definition at line 290 of file Integer.java.

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

Converts a Prolog term (known to be an integer) to a new Integer instance.

Parameters:
vars_to_Vars A Map from Prolog variables to JPL Variables
term The Prolog term (an integer) which is to be converted
Returns:
A new Integer instance

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)

Returns:
whether this Integer's functor has (double) 'name' and 'arity'

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)

Returns:
whether this Integer's functor has (String) 'name' and 'arity'

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)

Returns:
whether this Integer's functor has (int) 'name' and 'arity'

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

Exceptions:
JPLException if the value of this Integer is too great to be represented as a Java int
Returns:
the int value of this Integer

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

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)

Returns:
the name of this Integer (never)

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.

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

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

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

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

Returns:
the Integer's value
Deprecated:

Definition at line 233 of file Integer.java.


Member Data Documentation

final long jpl::Integer::value [protected]

the Integer's immutable long value

Definition at line 74 of file Integer.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