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)
Term
addSynonym
in interface Term
synonym
- the synonympublic void removeSynonym(Object synonym)
Term
removeSynonym
in interface Term
public Object[] getSynonyms()
Term
getSynonyms
in interface Term
public String getName()
Term
public String getDescription()
Term
getDescription
in interface Term
public void setDescription(String desc)
Term
setDescription
in interface Term
public Ontology getOntology()
Term
getOntology
in interface Term
public Term getSubject()
Triple
getSubject
in interface Triple
public Term getObject()
Triple
public Term getPredicate()
Triple
getPredicate
in interface Triple
public Annotation getAnnotation()
Annotatable
getAnnotation
in interface Annotatable
public int hashCode()
Triple
This 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.