org.apache.clerezza.rdf.core
Interface Graph
- All Superinterfaces:
- Collection<Triple>, Iterable<Triple>, TripleCollection
- All Known Implementing Classes:
- AbstractGraph, PrivilegedGraphWrapper, SimpleGraph
public interface Graph
- extends TripleCollection
A graph, modeled as a set of triples.
This interface does not extend java.util.Set because of the different
identity constraints, i.e. two Graphs may be equal (isomorphic)
even if the set of triples are not.
Implementations MUST be immutable and throw respective exceptions, when
add/remove-methods are called.
- Author:
- reto
- See Also:
AbstractGraph
|
Method Summary |
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. |
| Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
equals
boolean equals(Object obj)
- Returns true if two graphs are isomorphic
- Specified by:
equals in interface Collection<Triple>- Overrides:
equals in class Object
- Returns:
- true if two graphs are isomorphic
hashCode
int hashCode()
- 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>- Overrides:
hashCode in class Object
- Returns:
- hash code
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.