org.deri.iris.facts
Class Facts

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

public class Facts
extends Object
implements IFacts

A manager for all facts stored in a knowledge-base.


Field Summary
protected  Map<IPredicate,IRelation> mPredicateRelationMap
          The map storing the predicate-relation relationship.
protected  IRelationFactory mRelationFactory
           
 
Constructor Summary
Facts(IRelationFactory relationFactory)
          Constructor.
Facts(Map<IPredicate,IRelation> rawFacts, IRelationFactory relationFactory)
          Construct a Facts object from a predicate-relation map.
 
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
 

Field Detail

mPredicateRelationMap

protected final Map<IPredicate,IRelation> mPredicateRelationMap
The map storing the predicate-relation relationship.


mRelationFactory

protected final IRelationFactory mRelationFactory
Constructor Detail

Facts

public Facts(IRelationFactory relationFactory)
Constructor.


Facts

public Facts(Map<IPredicate,IRelation> rawFacts,
             IRelationFactory relationFactory)
Construct a Facts object from a predicate-relation map.

Parameters:
rawFacts - The facts to add.
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