public static final class Triple.Impl extends Object implements Triple, Serializable
org.biojavax.ontology.SimpleComparableTriple,
Serialized FormTriple.Impl| Constructor and Description |
|---|
Impl(Term subject,
Term object,
Term predicate) |
Impl(Term subject,
Term object,
Term predicate,
Object[] synonyms) |
Impl(Term subject,
Term object,
Term predicate,
String name,
String description) |
Impl(Term subject,
Term object,
Term predicate,
String name,
String description,
Object[] synonyms) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSynonym(Object synonym)
Add a synonym for this term.
|
boolean |
equals(Object o)
Two triples are equal if all their fields are identical.
|
Annotation |
getAnnotation()
Should return the associated annotation object.
|
String |
getDescription()
Return a human-readable description of this term, or the empty string if
none is available.
|
String |
getName()
Return the name of this term.
|
Term |
getObject()
Return the object term of this triple.
|
Ontology |
getOntology()
Return the ontology in which this term exists.
|
Term |
getPredicate()
Return a Term which defines the type of relationship between the subject and object terms.
|
Term |
getSubject()
Return the subject term of this triple
|
Object[] |
getSynonyms()
Return the synonyms for this term.
|
int |
hashCode()
The hashcode for a Triple.
|
void |
removeSynonym(Object synonym)
Remove a synonym for this term.
|
void |
setDescription(String desc)
set the description of the term;
|
String |
toString() |
public void addSynonym(Object synonym)
TermaddSynonym in interface Termsynonym - the synonympublic void removeSynonym(Object synonym)
TermremoveSynonym in interface Termpublic Object[] getSynonyms()
TermgetSynonyms in interface Termpublic String getName()
Termpublic String getDescription()
TermgetDescription in interface Termpublic void setDescription(String desc)
TermsetDescription in interface Termpublic Ontology getOntology()
TermgetOntology in interface Termpublic Term getSubject()
TriplegetSubject in interface Triplepublic Term getObject()
Triplepublic Term getPredicate()
TriplegetPredicate in interface Triplepublic Annotation getAnnotation()
AnnotatablegetAnnotation in interface Annotatablepublic int hashCode()
TripleThis must be implemented as:
return getSubject().hashCode() + 31 * getObject().hashCode() + 31 * 31 * getPredicate().hashCode();If you do not implement hashcode in this way then you have no guarantee that your Triple objects will be found in an ontology and that they will not be duplicated.
Copyright © 2000–2018 BioJava. All rights reserved.