org.deri.iris.optimisations.magicsets
Class AdornedProgram

java.lang.Object
  extended by org.deri.iris.optimisations.magicsets.AdornedProgram

public class AdornedProgram
extends Object

This is a simple implementation of an adorned program. NOTE: At the moment this class only works with rules with one literal in the head.

Author:
Richard P??ttler (richard dot poettler at sti2 dot at)

Nested Class Summary
static class AdornedProgram.AdornedPredicate
           Represents an adorned predicate.
static class AdornedProgram.AdornedRule
           Simple representation of an adorned rule.
 
Constructor Summary
AdornedProgram(Collection<IRule> rules, IQuery query)
          Creates a new adorned program depending on the submitted rules and the query.
 
Method Summary
 boolean equals(Object object)
           
 Set<AdornedProgram.AdornedPredicate> getAdornedPredicates()
           
 Set<AdornedProgram.AdornedRule> getAdornedRules()
           
 Set<IRule> getNormalRules()
           
 IQuery getQuery()
           
 int hashCode()
           
 String toString()
           This returns a simple string representation of this program.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdornedProgram

public AdornedProgram(Collection<IRule> rules,
                      IQuery query)
Creates a new adorned program depending on the submitted rules and the query.

Parameters:
rules - for which to create the program
query - for the program
Throws:
IllegalArgumentException - if the rules are null
IllegalArgumentException - if the queries are null
IllegalArgumentException - if the size of the head literals, or of the query literals is bigger than 1
IllegalArgumentException - if the list of rules contains null
Method Detail

toString

public String toString()

This returns a simple string representation of this program. The subject of this representation is to change.

The return of this method will look something like: all adorned rules with one line for each rule, blank line, all normal rules with one line for each rule, blank line, the query.

Overrides:
toString in class Object
Returns:
the string representation

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

getAdornedRules

public Set<AdornedProgram.AdornedRule> getAdornedRules()

getNormalRules

public Set<IRule> getNormalRules()

getAdornedPredicates

public Set<AdornedProgram.AdornedPredicate> getAdornedPredicates()

getQuery

public IQuery getQuery()