jpl
Class JBoolean

java.lang.Object
  extended byjpl.Term
      extended byjpl.JBoolean

public class JBoolean
extends Term

A jpl.JBoolean is a specialised Term with a boolean field, representing JPL's Prolog representation of a Java boolean value.

 JBoolean b = new JBoolean( true or false );
 
A JBoolean can be used (and re-used) in Compound Terms.
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.


Version:
$Revision: 1.2 $
See Also:
Term, Compound

Constructor Summary
JBoolean(boolean b)
          Constructs a JBoolean with the supplied boolean value.
 
Method Summary
 Term[] args()
          Deprecated.  
 boolean boolValue()
          The boolean value which this jpl.JBoolean object represents
 java.lang.String debugString()
          Deprecated.  
 boolean equals(java.lang.Object obj)
          Two JBooleans are equal if their values are equal
 boolean hasFunctor(java.lang.String name, int arity)
          Tests whether this JBoolean's functor has (String) 'name' and 'arity'
 java.lang.String toString()
          Returns a Prolog source text representation of this JBoolean
 int type()
          returns the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc
 java.lang.String typeName()
          returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc
 
Methods inherited from class jpl.Term
arg, arity, debugString, doubleValue, floatValue, hasFunctor, hasFunctor, intValue, isAtom, isCompound, isFloat, isInteger, isJBoolean, isJRef, isJVoid, isVariable, listLength, longValue, name, putParams, putParams, toString, toTermArray
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JBoolean

public JBoolean(boolean b)
Constructs a JBoolean with the supplied boolean value.

Parameters:
b - this JBoolean's value (a boolean)
Method Detail

hasFunctor

public final boolean hasFunctor(java.lang.String name,
                                int arity)
Tests whether this JBoolean's functor has (String) 'name' and 'arity'

Overrides:
hasFunctor in class Term
Returns:
whether this JBoolean's functor has (String) 'name' and 'arity'

toString

public java.lang.String toString()
Returns a Prolog source text representation of this JBoolean

Returns:
a Prolog source text representation of this JBoolean

equals

public final boolean equals(java.lang.Object obj)
Two JBooleans are equal if their values are equal

Parameters:
obj - The Object to compare (not necessarily a JBoolean)
Returns:
true if the Object satisfies the above condition

boolValue

public boolean boolValue()
The boolean value which this jpl.JBoolean object represents

Returns:
the boolean value which this jpl.JBoolean object represents

type

public final int type()
Description copied from class: Term
returns the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc

Specified by:
type in class Term
Returns:
the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc

typeName

public java.lang.String typeName()
Description copied from class: Term
returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc

Specified by:
typeName in class Term
Returns:
the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc

args

public Term[] args()
Deprecated.  

The (nonexistent) args of this JBoolean

Specified by:
args in class Term
Returns:
the (nonexistent) args of this JBoolean

debugString

public java.lang.String debugString()
Deprecated.  

Returns a debug-friendly representation of this JBoolean

Specified by:
debugString in class Term
Returns:
a debug-friendly representation of this JBoolean