org.apache.clerezza.rdf.core.impl
Class TripleImpl
java.lang.Object
org.apache.clerezza.rdf.core.impl.TripleImpl
- All Implemented Interfaces:
- Triple
public class TripleImpl
- extends Object
- implements Triple
- Author:
- reto
TripleImpl
public TripleImpl(NonLiteral subject,
UriRef predicate,
Resource object)
- Creates a new
TripleImpl.
- Parameters:
subject - the subject.predicate - the predicate.object - the object.
- Throws:
IllegalArgumentException - if an attribute is null.
equals
public boolean equals(Object obj)
- Specified by:
equals in interface Triple- Overrides:
equals in class Object
- Returns:
- true iff subject, predicate, and object of both triples are equal
hashCode
public int hashCode()
- Description copied from interface:
Triple
- The hash code is computed as follow
(subject.hashCode() >> 1) ^ subject.hashCode() ^ subject.hashCode() << 1)
Note that the hash returned is computed including the hash of BNodes, so
it is not blank-node blind as in Graph.
This would have to change if triple should extend Graph
- Specified by:
hashCode in interface Triple- Overrides:
hashCode in class Object
- Returns:
- hash code
getSubject
public NonLiteral getSubject()
- Specified by:
getSubject in interface Triple
getPredicate
public UriRef getPredicate()
- Specified by:
getPredicate in interface Triple
getObject
public Resource getObject()
- Specified by:
getObject in interface Triple
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.