|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojavax.ontology.SimpleComparableTerm
public class SimpleComparableTerm
A Term object that can be compared and thus sorted.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.biojava.ontology.Term |
---|
Term.Impl |
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable |
---|
Annotatable.AnnotationForwarder |
Field Summary |
---|
Fields inherited from interface org.biojavax.ontology.ComparableTerm |
---|
DESCRIPTION, IDENTIFIER, OBSOLETE, RANKEDCROSSREF |
Fields inherited from interface org.biojava.ontology.Term |
---|
ONTOLOGY |
Fields inherited from interface org.biojava.bio.Annotatable |
---|
ANNOTATION |
Constructor Summary | |
---|---|
protected |
SimpleComparableTerm()
|
Method Summary | |
---|---|
void |
addRankedCrossRef(RankedCrossRef crossref)
Adds a ranked cross reference to the existing set. |
void |
addSynonym(Object synonym)
Add a synonym for this term. Synonyms are stored in the database as the results of a toString() operation on each synonym object. |
int |
compareTo(Object o)
Terms are sorted by ontology first, then name. |
boolean |
equals(Object obj)
Two terms are equal if they are in the same ontology and share the same name. |
Annotation |
getAnnotation()
Should return the associated annotation object. ALWAYS RETURNS AN EMPTY ANNOTATION OBJECT |
String |
getDescription()
Return a human-readable description of this term, or the empty string if none is available. |
Integer |
getId()
Gets the Hibernate ID. |
String |
getIdentifier()
Returns the (optional) identifier associated with this term. |
String |
getName()
Return the name of this term. |
Boolean |
getObsolete()
Checks to see if this term is obsolete. |
Ontology |
getOntology()
Return the ontology in which this term exists. |
Set |
getRankedCrossRefs()
Returns the set of all ranked cross references associated with an object. Warning this method gives access to the original Collection not a copy. |
Object[] |
getSynonyms()
Return the synonyms for this term. |
int |
hashCode()
|
void |
removeRankedCrossRef(RankedCrossRef crossref)
Removes a ranked cross reference from the existing set. |
void |
removeSynonym(Object synonym)
Remove a synonym for this term. |
void |
setDescription(String description)
set the description of the term; |
void |
setId(Integer id)
Sets the Hibernate ID. |
void |
setIdentifier(String identifier)
Sets the (optional) identifier associated with this term. |
void |
setObsolete(Boolean obsolete)
Sets the obsolescence flag associated with this term. |
void |
setRankedCrossRefs(Set rankedcrossrefs)
Sets the ranked cross references associated with an object. Warning this method gives access to the original Collection not a copy. |
String |
toString()
Form: "ontology:name [obsolete]" where [obsolete] is optional |
Methods inherited from class org.biojava.utils.AbstractChangeable |
---|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.biojava.utils.Changeable |
---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Constructor Detail |
---|
protected SimpleComparableTerm()
Method Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public int compareTo(Object o)
compareTo
in interface Comparable
public void addSynonym(Object synonym)
addSynonym
in interface Term
synonym
- the synonympublic void removeSynonym(Object synonym)
removeSynonym
in interface Term
public Object[] getSynonyms()
getSynonyms
in interface Term
public Set getRankedCrossRefs()
getRankedCrossRefs
in interface RankedCrossRefable
public void setRankedCrossRefs(Set rankedcrossrefs) throws ChangeVetoException
setRankedCrossRefs
in interface RankedCrossRefable
rankedcrossrefs
- a set of RankedCrossRef objects.
ChangeVetoException
- if the set was null or any of its contents
were not RankedCrossRef objects.public void addRankedCrossRef(RankedCrossRef crossref) throws ChangeVetoException
addRankedCrossRef
in interface RankedCrossRefable
crossref
- the ranked cross reference to add.
ChangeVetoException
- if the parameter is null.public void removeRankedCrossRef(RankedCrossRef crossref) throws ChangeVetoException
removeRankedCrossRef
in interface RankedCrossRefable
crossref
- the ranked cross reference to remove.
ChangeVetoException
- if the parameter is null.public String getName()
getName
in interface Term
public String getDescription()
getDescription
in interface Term
public void setDescription(String description) throws ChangeVetoException
setDescription
in interface Term
setDescription
in interface ComparableTerm
description
- the description to give the term. Nullable.
ChangeVetoException
- if the description is unacceptable.public Ontology getOntology()
getOntology
in interface Term
public String toString()
toString
in class Object
public Annotation getAnnotation()
getAnnotation
in interface Annotatable
public String getIdentifier()
getIdentifier
in interface ComparableTerm
public void setIdentifier(String identifier) throws ChangeVetoException
setIdentifier
in interface ComparableTerm
identifier
- the identifier to give the term. Null will unset it.
ChangeVetoException
- if the identifier is unacceptable.public Boolean getObsolete()
getObsolete
in interface ComparableTerm
public void setObsolete(Boolean obsolete) throws ChangeVetoException
setObsolete
in interface ComparableTerm
obsolete
- true if it is obsolete, false if not. Nullable.
ChangeVetoException
- if the change is unacceptable.public Integer getId()
public void setId(Integer id)
id
- the Hibernate ID, if using Hibernate.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |