org.apache.clerezza.rdf.core.impl
Class AbstractGraph

java.lang.Object
  extended by java.util.AbstractCollection<Triple>
      extended by org.apache.clerezza.rdf.core.impl.AbstractTripleCollection
          extended by org.apache.clerezza.rdf.core.impl.AbstractGraph
All Implemented Interfaces:
Iterable<Triple>, Collection<Triple>, Graph, TripleCollection
Direct Known Subclasses:
SimpleGraph

public abstract class AbstractGraph
extends AbstractTripleCollection
implements Graph

AbstractGraph is an abstract implementation of Graph implementing the equals and the hashCode methods.

Author:
reto

Constructor Summary
AbstractGraph()
           
 
Method Summary
 boolean add(Triple e)
           
 boolean addAll(Collection<? extends Triple> c)
           
 void clear()
           
 boolean equals(Object obj)
          Returns true if two graphs are isomorphic
 int hashCode()
          Return the sum of the blank-nodes independent hashes of the triples.
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 
Methods inherited from class org.apache.clerezza.rdf.core.impl.AbstractTripleCollection
addGraphListener, addGraphListener, contains, dispatchEvent, filter, iterator, performAdd, performFilter, performRemove, removeGraphListener
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.clerezza.rdf.core.TripleCollection
addGraphListener, addGraphListener, filter, removeGraphListener
 
Methods inherited from interface java.util.Collection
contains, containsAll, isEmpty, iterator, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractGraph

public AbstractGraph()
Method Detail

hashCode

public final int hashCode()
Description copied from interface: Graph
Return the sum of the blank-nodes independent hashes of the triples. More precisely the hash of the triple is calculated as follows: (hash(subject) >> 1) ^ hash(hashCode) ^ (hash(hashCode) << 1) Where the hash-fucntion return the hashCode of the argument for grounded arguments and 0 otherwise.

Specified by:
hashCode in interface Collection<Triple>
Specified by:
hashCode in interface Graph
Overrides:
hashCode in class Object
Returns:
hash code

add

public boolean add(Triple e)
Specified by:
add in interface Collection<Triple>
Overrides:
add in class AbstractTripleCollection

addAll

public boolean addAll(Collection<? extends Triple> c)
Specified by:
addAll in interface Collection<Triple>
Overrides:
addAll in class AbstractCollection<Triple>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Triple>
Overrides:
remove in class AbstractTripleCollection

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Triple>
Overrides:
removeAll in class AbstractTripleCollection

clear

public void clear()
Specified by:
clear in interface Collection<Triple>
Overrides:
clear in class AbstractCollection<Triple>

equals

public boolean equals(Object obj)
Description copied from interface: Graph
Returns true if two graphs are isomorphic

Specified by:
equals in interface Collection<Triple>
Specified by:
equals in interface Graph
Overrides:
equals in class Object
Returns:
true if two graphs are isomorphic


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.