org.apache.clerezza.rdf.core.impl
Class AbstractGraph
java.lang.Object
java.util.AbstractCollection<Triple>
org.apache.clerezza.rdf.core.impl.AbstractTripleCollection
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
AbstractGraph
public AbstractGraph()
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.