org.deri.iris.basics
Class BasicFactory

java.lang.Object
  extended by org.deri.iris.basics.BasicFactory
All Implemented Interfaces:
IBasicFactory

public class BasicFactory
extends Object
implements IBasicFactory

Simple implementatiion of the basic factory.

$Id$

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

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 positive, IPredicate p, 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)
           
static IBasicFactory getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createAtom

public IAtom createAtom(IPredicate p,
                        ITuple tuple)
Specified by:
createAtom in interface IBasicFactory

createLiteral

public ILiteral createLiteral(boolean isPositive,
                              IAtom atom)
Specified by:
createLiteral in interface IBasicFactory

createLiteral

public ILiteral createLiteral(boolean positive,
                              IPredicate p,
                              ITuple tuple)
Specified by:
createLiteral in interface IBasicFactory

createPredicate

public IPredicate createPredicate(String symbol,
                                  int arity)
Specified by:
createPredicate in interface IBasicFactory

createQuery

public IQuery createQuery(ILiteral... literals)
Specified by:
createQuery in interface IBasicFactory

createQuery

public IQuery createQuery(List<ILiteral> literals)
Specified by:
createQuery in interface IBasicFactory

createRule

public IRule createRule(List<ILiteral> head,
                        List<ILiteral> body)
Description copied from interface: IBasicFactory
Creates a rule out of a list of head and a list of body literals.

Specified by:
createRule in interface IBasicFactory
Parameters:
head - the head literals
body - the body literals

createTuple

public ITuple createTuple(ITerm... terms)
Specified by:
createTuple in interface IBasicFactory

createTuple

public ITuple createTuple(List<ITerm> terms)
Specified by:
createTuple in interface IBasicFactory

createAtom

public IAtom createAtom(IAtom a)
Description copied from interface: IBasicFactory
Creates a deep copy of an atom. The terms themsemves will remain the same instances.

Specified by:
createAtom in interface IBasicFactory
Parameters:
a - the atom to copy
Returns:
the copy

createLiteral

public ILiteral createLiteral(ILiteral l)
Description copied from interface: IBasicFactory
Creates a deep copy of a literal. The terms themsemves will remain the same instances.

Specified by:
createLiteral in interface IBasicFactory
Parameters:
l - the tuple to copy
Returns:
the copy

getInstance

public static IBasicFactory getInstance()