public static final class OntologyTerm.Impl extends AbstractChangeable implements OntologyTerm, Serializable
OntologyTerm.Impl
Annotatable.AnnotationForwarder
ANNOTATION
Constructor and Description |
---|
OntologyTerm.Impl(Ontology ontology,
Ontology target) |
OntologyTerm.Impl(Ontology ontology,
Ontology target,
Object[] synonyms) |
Modifier and Type | Method and Description |
---|---|
void |
addSynonym(Object synonym)
Add a synonym for this term.
|
Annotation |
getAnnotation()
Should return the associated annotation object.
|
ChangeSupport |
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this 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.
|
Ontology |
getOntology()
Get the remote ontology referenced by this term
|
Object[] |
getSynonyms()
Return the synonyms for this term.
|
Ontology |
getTargetOntology() |
void |
removeSynonym(Object synonym)
Remove a synonym for this term.
|
void |
setDescription(String description)
set the description of the term;
|
String |
toString() |
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public OntologyTerm.Impl(Ontology ontology, Ontology target)
public OntologyTerm.Impl(Ontology ontology, Ontology target, Object[] synonyms)
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 description)
Term
setDescription
in interface Term
public Ontology getOntology()
OntologyTerm
getOntology
in interface OntologyTerm
getOntology
in interface Term
public Ontology getTargetOntology()
public Annotation getAnnotation()
Annotatable
getAnnotation
in interface Annotatable
public ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to
be transient and lazily instantiated. Be sure to register & unregister the
forwarder in the code that does the ChangeEvent handling in setter methods.
ChangeSupport cs = super.getChangeSupport(ct);
if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
someForwarder = new ChangeForwarder(...
this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
}
return cs;
getChangeSupport
in class AbstractChangeable
Copyright © 2014 BioJava. All rights reserved.