org.jrdf.query.relation.mem
Class GraphRelationImpl

java.lang.Object
  extended by org.jrdf.query.relation.mem.GraphRelationImpl
All Implemented Interfaces:
GraphRelation, Relation

public final class GraphRelationImpl
extends Object
implements GraphRelation

Implementation of relations containing 3 column heading (subject, predicate, object).

Version:
$Id: RelationImpl.java 556 2006-06-13 06:38:55Z newmana $
Author:
Andrew Newman

Constructor Summary
GraphRelationImpl(Graph graph, SortedAttributeFactory attributeFactory, AttributeValuePairHelper avpHelper, TupleComparator tupleComparator, TupleFactory tupleFactory)
           
 
Method Summary
 boolean equals(Object obj)
           
 Set<Attribute> getHeading()
          Returns the set of attributes or heading of the relation.
 SortedSet<Attribute> getSortedHeading()
           
 SortedSet<Tuple> getSortedTuples()
           
 Set<Tuple> getTuples()
          Returns the set of tuples.
 Set<Tuple> getTuples(List<AttributeValuePair> nameValues)
          Returns the set of tuples based on the constraints given 3 attribute/value pairs.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphRelationImpl

public GraphRelationImpl(Graph graph,
                         SortedAttributeFactory attributeFactory,
                         AttributeValuePairHelper avpHelper,
                         TupleComparator tupleComparator,
                         TupleFactory tupleFactory)
Method Detail

getHeading

public Set<Attribute> getHeading()
Description copied from interface: Relation
Returns the set of attributes or heading of the relation.

Specified by:
getHeading in interface Relation
Returns:
the set of attributes or heading of the relation.

getTuples

public Set<Tuple> getTuples()
Description copied from interface: Relation
Returns the set of tuples.

Specified by:
getTuples in interface Relation
Returns:
a set of tuples.

getTuples

public Set<Tuple> getTuples(List<AttributeValuePair> nameValues)
Description copied from interface: GraphRelation
Returns the set of tuples based on the constraints given 3 attribute/value pairs. Either of variable, type and ANY_NODE or position name, type and node value.

Specified by:
getTuples in interface GraphRelation
Parameters:
nameValues - an ordered list of 3 attribute value pairs in the subject, predicate and object position.
Returns:
a set of tuples.

getSortedHeading

public SortedSet<Attribute> getSortedHeading()
Specified by:
getSortedHeading in interface Relation

getSortedTuples

public SortedSet<Tuple> getSortedTuples()
Specified by:
getSortedTuples in interface Relation

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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