org.deri.iris.api.factory
Interface IBasicFactory

All Known Implementing Classes:
BasicFactory

public interface IBasicFactory

An interface that can be used to create set of basic logical entities such as predicates, atoms, rules, queries etc.

$Id: IBasicFactory.java,v 1.19 2007-10-30 09:15:07 bazbishop237 Exp $

Version:
$Revision: 1.19 $
Author:
Darko Anicic, DERI Innsbruck, Richard P??ttler (richard dot poettler at deri dot org)

Method Summary
 IAtom createAtom(IAtom a)
          Creates a deep copy of an atom.
 IAtom createAtom(IPredicate p, ITuple tuple)
           
 ILiteral createLiteral(boolean isPositive, IAtom atom)
           
 ILiteral createLiteral(boolean isPositive, IPredicate predicate, ITuple tuple)
           
 ILiteral createLiteral(ILiteral l)
          Creates a deep copy of a literal.
 IPredicate createPredicate(String symbol, int arity)
           
 IQuery createQuery(ILiteral... literals)
           
 IQuery createQuery(List<ILiteral> literals)
           
 IRule createRule(List<ILiteral> head, List<ILiteral> body)
          Creates a rule out of a list of head and a list of body literals.
 ITuple createTuple(ITerm... terms)
           
 ITuple createTuple(List<ITerm> terms)
           
 

Method Detail

createAtom

IAtom createAtom(IPredicate p,
                 ITuple tuple)

createAtom

IAtom createAtom(IAtom a)
Creates a deep copy of an atom. The terms themsemves will remain the same instances.

Parameters:
a - the atom to copy
Returns:
the copy
Throws:
NullPointerException - if the atom is null
IllegalArgumentException - if the atom is a builtin one.
Since:
0.3

createLiteral

ILiteral createLiteral(boolean isPositive,
                       IAtom atom)

createLiteral

ILiteral createLiteral(boolean isPositive,
                       IPredicate predicate,
                       ITuple tuple)

createLiteral

ILiteral createLiteral(ILiteral l)
Creates a deep copy of a literal. The terms themsemves will remain the same instances.

Parameters:
l - the tuple to copy
Returns:
the copy
Throws:
NullPointerException - if the literal is null
IllegalArgumentException - if the underlying atom is a builtin one.
Since:
0.3

createPredicate

IPredicate createPredicate(String symbol,
                           int arity)

createQuery

IQuery createQuery(ILiteral... literals)

createQuery

IQuery createQuery(List<ILiteral> literals)

createRule

IRule createRule(List<ILiteral> head,
                 List<ILiteral> body)
Creates a rule out of a list of head and a list of body literals.

Parameters:
head - the head literals
body - the body literals

createTuple

ITuple createTuple(ITerm... terms)

createTuple

ITuple createTuple(List<ITerm> terms)