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) |
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) 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 Atom.java.
jpl::Atom::Atom | ( | String | name | ) | [inline] |
String jpl::Atom::debugString | ( | ) | [inline, virtual] |
Returns a debug-friendly String representation of an Atom.
Reimplemented from jpl::Compound.
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).
vars_to_Vars | A Map from Prolog variables to JPL Variables. | |
term | The term_t to convert |
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.
vars_to_Vars | A Map from Prolog variables to JPL Variables. | |
term | The Prolog term to be converted |
Reimplemented from jpl::Compound.
Object jpl::Atom::jrefToObject | ( | ) | [inline, virtual] |
Reimplemented from jpl::Compound.
final int jpl::Atom::type | ( | ) | [inline, virtual] |
returns the type of this term, as jpl.fli.Prolog.COMPOUND
Reimplemented from jpl::Compound.
String jpl::Atom::typeName | ( | ) | [inline, virtual] |
returns the name of the type of this term, as "Atom"
Reimplemented from jpl::Compound.