jpl
Class Atom

java.lang.Object
  extended by jpl.Term
      extended by jpl.Compound
          extended by jpl.Atom

public class Atom
extends Compound

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.


See Also:
Term, Compound

Constructor Summary
Atom(java.lang.String name)
           
 
Method Summary
 java.lang.String debugString()
          Deprecated.  
 java.lang.Object jrefToObject()
           
 int type()
          returns the type of this term, as jpl.fli.Prolog.COMPOUND
 java.lang.String typeName()
          returns the name of the type of this term, as "Atom"
 
Methods inherited from class jpl.Compound
arg, arg0, args, arity, equals, hasFunctor, hasFunctor, hasFunctor, isJFalse, isJNull, isJObject, isJRef, isJTrue, isJVoid, name, setArg, toString
 
Methods inherited from class jpl.Term
debugString, doubleValue, floatValue, intValue, isAtom, isCompound, isFloat, isInteger, isVariable, listLength, longValue, objectToJRef, put, putParams, putParams, putTerm, toString, toTermArray
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Atom

public Atom(java.lang.String name)
Parameters:
name - the Atom's name (unquoted)
Method Detail

type

public final int type()
Description copied from class: Compound
returns the type of this term, as jpl.fli.Prolog.COMPOUND

Overrides:
type in class Compound
Returns:
the type of this term, as jpl.fli.Prolog.COMPOUND

typeName

public java.lang.String typeName()
returns the name of the type of this term, as "Atom"

Overrides:
typeName in class Compound
Returns:
the name of the type of this term, as "Atom"

jrefToObject

public java.lang.Object jrefToObject()
Overrides:
jrefToObject in class Compound

debugString

public java.lang.String debugString()
Deprecated. 

Returns a debug-friendly String representation of an Atom.

Overrides:
debugString in class Compound
Returns:
a debug-friendly String representation of an Atom