jpl::Atom Class Reference

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

List of all members.

Public Member Functions

 Atom (String name)
String debugString ()
Object jrefToObject ()
final int type ()
String typeName ()

Static Protected Member Functions

static Term getString (Map vars_to_Vars, term_t term)
static Term getTerm1 (Map vars_to_Vars, term_t term)

Detailed Description

Atom is a specialised Compound with zero arguments, representing a Prolog atom with the same name. An Atom is constructed with a String parameter (its name, unquoted), which cannot thereafter be changed.

Atom a = new Atom("hello");

An Atom can be used (and re-used) as an argument of Compound Terms. Two Atom instances are equal (by equals()) iff they have equal names.


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 Atom.java.


Constructor & Destructor Documentation

jpl::Atom::Atom ( String  name  )  [inline]
Parameters:
name the Atom's name (unquoted)

Definition at line 78 of file Atom.java.


Member Function Documentation

String jpl::Atom::debugString (  )  [inline, virtual]

Returns a debug-friendly String representation of an Atom.

Returns:
a debug-friendly String representation of an Atom
Deprecated:

Reimplemented from jpl::Compound.

Definition at line 114 of file Atom.java.

static Term jpl::Atom::getString ( Map  vars_to_Vars,
term_t  term 
) [inline, static, protected]

Converts a Prolog term (as a term_t), which is known to be a SWI-Prolog string, to a new jpl.Atom, by creating a new Atom object initialised with the string's value. JPL users should avoid SWI-Prolog's non-ISO strings, but in some obscure circumstances they are returned unavoidably, so we have to handle them (and this is how).

Parameters:
vars_to_Vars A Map from Prolog variables to JPL Variables.
term The term_t to convert
Returns:
A new Atom instance

Definition at line 155 of file Atom.java.

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

Converts a Prolog term (as a term_t), which is known to be an atom, to a new jpl.Atom. This is only called from Term.getTerm(), and just creates a new Atom object initialised with the atom's name.

Parameters:
vars_to_Vars A Map from Prolog variables to JPL Variables.
term The Prolog term to be converted
Returns:
A new Atom instance

Reimplemented from jpl::Compound.

Definition at line 137 of file Atom.java.

Object jpl::Atom::jrefToObject (  )  [inline, virtual]

Reimplemented from jpl::Compound.

Definition at line 101 of file Atom.java.

final int jpl::Atom::type (  )  [inline, virtual]

returns the type of this term, as jpl.fli.Prolog.COMPOUND

Returns:
the type of this term, as jpl.fli.Prolog.COMPOUND

Reimplemented from jpl::Compound.

Definition at line 88 of file Atom.java.

String jpl::Atom::typeName (  )  [inline, virtual]

returns the name of the type of this term, as "Atom"

Returns:
the name of the type of this term, as "Atom"

Reimplemented from jpl::Compound.

Definition at line 97 of file Atom.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