com.ugos.JIProlog.engine
Class JIPClausesDatabase

java.lang.Object
  |
  +--com.ugos.JIProlog.engine.JIPClausesDatabase

public abstract class JIPClausesDatabase
extends java.lang.Object

JIPClausesDatabase is the base class for external database of clauses
To implement a custom database of clauses, developers should implement the following methods:
- setAttributes
- addClauseAt
- addClause
- removeClause
- clauses
For more information see the section "How to implement a custom detabase of clauses" in the Reference Manual.

Version:
2.0
Author:
Ugo Chirico 2002
Home Page: http://www.ugosweb.com/jiprolog
See Also:
JIPClausesEnumeration

Constructor Summary
JIPClausesDatabase()
          Constucts a new JIPClausesDatabase
 
Method Summary
abstract  boolean addClause(JIPClause clause)
          Appends a clause to the database
Note that some databases may not allow to append a clause.
abstract  boolean addClauseAt(int nPos, JIPClause clause)
          Adds a clause to the database at the position specified
Note that some databases may not allow to add a clause at a given position.
abstract  java.util.Enumeration clauses()
          Returns an enumeration of the clauses contained in this database
 int getArity()
          Returns the arity of the functor associated to this database
 java.lang.String getFunctorName()
          Returns the name of the functor associated to this database
 JIPEngine getJIPEngine()
          Returns the JIPEngine object attached to this database
abstract  boolean removeClause(JIPClause clause)
          Removes a clause from the database Note that some databases may not allow to remove a clause.
abstract  void setAttributes(java.lang.String strAttribs)
          Sets the attributes to pass to the database (i.e. login info, filename, etc.)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIPClausesDatabase

public JIPClausesDatabase()
Constucts a new JIPClausesDatabase

Method Detail

getFunctorName

public final java.lang.String getFunctorName()
Returns the name of the functor associated to this database


getArity

public final int getArity()
Returns the arity of the functor associated to this database


getJIPEngine

public final JIPEngine getJIPEngine()
Returns the JIPEngine object attached to this database


setAttributes

public abstract void setAttributes(java.lang.String strAttribs)
Sets the attributes to pass to the database (i.e. login info, filename, etc.)

Parameters:
strAttribs - the attributes to pass

addClauseAt

public abstract boolean addClauseAt(int nPos,
                                    JIPClause clause)
Adds a clause to the database at the position specified
Note that some databases may not allow to add a clause at a given position.

Parameters:
nPos - Position of the clause to add
clause - Clause to add
Returns:
true if the clause has been added.
See Also:
JIPClause

addClause

public abstract boolean addClause(JIPClause clause)
Appends a clause to the database
Note that some databases may not allow to append a clause.

Parameters:
clause - Clause to add
Returns:
true if the clause has been appended.
See Also:
JIPClause

removeClause

public abstract boolean removeClause(JIPClause clause)
Removes a clause from the database Note that some databases may not allow to remove a clause.

Parameters:
clause - Clause to remove
Returns:
true if the clause has been removed.
See Also:
JIPClause

clauses

public abstract java.util.Enumeration clauses()
Returns an enumeration of the clauses contained in this database

Returns:
an enumeration of the clauses contained in this database
See Also:
JIPClause, JIPClausesEnumeration