org.deri.iris.facts
Class OriginalFactsPreservingFacts

java.lang.Object
  extended by org.deri.iris.facts.OriginalFactsPreservingFacts
All Implemented Interfaces:
IFacts

public class OriginalFactsPreservingFacts
extends Object
implements IFacts

A facts adaptor that allows modification (i.e. adding more facts) without modifying the original facts.


Constructor Summary
OriginalFactsPreservingFacts(IFacts original, IRelationFactory relationFactory)
          Constructor.
 
Method Summary
 IRelation get(IPredicate predicate)
          Get the relation associated with the given predicate and create one if one does not already exist.
 Set<IPredicate> getPredicates()
          Get the set of predicate identifying all relations known to this facts object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OriginalFactsPreservingFacts

public OriginalFactsPreservingFacts(IFacts original,
                                    IRelationFactory relationFactory)
Constructor. Decorate the given facts object.

Parameters:
original - The original facts that will be preserved, i.e. not altered by this class.
relationFactory - The relation factory to use.
Method Detail

get

public IRelation get(IPredicate predicate)
Description copied from interface: IFacts
Get the relation associated with the given predicate and create one if one does not already exist.

Specified by:
get in interface IFacts
Parameters:
predicate - The predicate identifying the relation.
Returns:
The relation associated with the given predicate.

getPredicates

public Set<IPredicate> getPredicates()
Description copied from interface: IFacts
Get the set of predicate identifying all relations known to this facts object.

Specified by:
getPredicates in interface IFacts
Returns:

toString

public String toString()
Overrides:
toString in class Object