uk.ac.ebi.intact.model
Class AnnotatedObjectImpl

java.lang.Object
  |
  +--uk.ac.ebi.intact.model.IntactObjectImpl
        |
        +--uk.ac.ebi.intact.model.BasicObjectImpl
              |
              +--uk.ac.ebi.intact.model.AnnotatedObjectImpl
All Implemented Interfaces:
AnnotatedObject, BasicObject, IntactObject, java.io.Serializable
Direct Known Subclasses:
BioSource, CvObject, Experiment, InteractorImpl

public abstract class AnnotatedObjectImpl
extends BasicObjectImpl
implements AnnotatedObject

Represents an object with biological annotation.

Author:
hhe
See Also:
Serialized Form

Field Summary
 java.util.Collection annotations
           
 Person curator
          The curator who has last edited the object.
protected  java.lang.String curatorAc
           
protected  java.lang.String fullName
          The full name or a minimal description of the object.
 java.util.Collection references
           
protected  java.lang.String shortLabel
          Short name for the object, not necessarily unique.
 java.util.Collection xrefs
           
 
Fields inherited from class uk.ac.ebi.intact.model.IntactObjectImpl
ac, NEW_LINE
 
Constructor Summary
protected AnnotatedObjectImpl()
          no-arg constructor provided for compatibility with subclasses that have no-arg constructors.
protected AnnotatedObjectImpl(java.lang.String shortLabel, Institution owner)
          Constructor for subclass use only.
 
Method Summary
 void addAlias(Alias alias)
          Adds an alias to the object.
 void addAnnotation(Annotation annotation)
           
 void addReference(Reference reference)
           
 void addXref(Xref aXref)
          Adds an xref to the object.
 boolean equals(java.lang.Object o)
          Equality for AnnotatedObjects is currently based on equality for Xrefs, shortLabels and fullNames.
 java.util.Collection getAliases()
           
 java.util.Collection getAnnotations()
           
 Person getCurator()
           
 java.lang.String getCuratorAc()
           
 java.lang.String getFullName()
           
 java.util.Collection getReferences()
           
 java.lang.String getShortLabel()
           
 java.util.Collection getXrefs()
           
 int hashCode()
          This class overwrites equals.
 void removeAlias(Alias alias)
           
 void removeAnnotation(Annotation annotation)
           
 void removeReference(Reference reference)
           
 void removeXref(Xref xref)
           
 void setAliases(java.util.Collection someAliases)
           
 void setAnnotation(java.util.Collection someAnnotation)
           
 void setCurator(Person person)
           
 void setCuratorAc(java.lang.String ac)
           
 void setFullName(java.lang.String fullName)
           
 void setReferences(java.util.Collection someReferences)
           
 void setShortLabel(java.lang.String shortLabel)
           
 void setXrefs(java.util.Collection someXrefs)
           
 java.lang.String toString()
           
 AnnotatedObject update(IntactHelper helper)
          Update an annotated object in the database.
 Annotation updateUniqueAnnotation(CvTopic topic, java.lang.String description, Institution owner)
          Create or update an annotation.
 
Methods inherited from class uk.ac.ebi.intact.model.BasicObjectImpl
addEvidence, getEvidences, getOwner, getOwnerAc, removeEvidence, setEvidences, setOwner, setOwnerAc
 
Methods inherited from class uk.ac.ebi.intact.model.IntactObjectImpl
getAc, getCreated, getUpdated, setAc, setCreated, setUpdated
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.ac.ebi.intact.model.BasicObject
addEvidence, getEvidences, getOwner, getOwnerAc, removeEvidence, setEvidences, setOwner, setOwnerAc
 
Methods inherited from interface uk.ac.ebi.intact.model.IntactObject
getAc, getCreated, getUpdated, setAc, setCreated, setUpdated
 

Field Detail

curatorAc

protected java.lang.String curatorAc

shortLabel

protected java.lang.String shortLabel
Short name for the object, not necessarily unique. To be used for example in minimised displays of the object.


fullName

protected java.lang.String fullName
The full name or a minimal description of the object.


annotations

public java.util.Collection annotations

curator

public Person curator
The curator who has last edited the object.


xrefs

public java.util.Collection xrefs

references

public java.util.Collection references
Constructor Detail

AnnotatedObjectImpl

protected AnnotatedObjectImpl()
no-arg constructor provided for compatibility with subclasses that have no-arg constructors.


AnnotatedObjectImpl

protected AnnotatedObjectImpl(java.lang.String shortLabel,
                              Institution owner)
Constructor for subclass use only. Ensures that AnnotatedObjects cannot be created without at least a shortLabel and an owner specified.

Parameters:
shortLabel - The memorable label to identify this AnnotatedObject
owner - The Institution which owns this AnnotatedObject
Throws:
java.lang.NullPointerException - thrown if either parameters are not specified
Method Detail

getShortLabel

public java.lang.String getShortLabel()
Specified by:
getShortLabel in interface AnnotatedObject

setShortLabel

public void setShortLabel(java.lang.String shortLabel)
Specified by:
setShortLabel in interface AnnotatedObject

getFullName

public java.lang.String getFullName()
Specified by:
getFullName in interface AnnotatedObject

setFullName

public void setFullName(java.lang.String fullName)
Specified by:
setFullName in interface AnnotatedObject

setAnnotation

public void setAnnotation(java.util.Collection someAnnotation)
Specified by:
setAnnotation in interface AnnotatedObject

getAnnotations

public java.util.Collection getAnnotations()
Specified by:
getAnnotations in interface AnnotatedObject

addAnnotation

public void addAnnotation(Annotation annotation)
Specified by:
addAnnotation in interface AnnotatedObject

removeAnnotation

public void removeAnnotation(Annotation annotation)
Specified by:
removeAnnotation in interface AnnotatedObject

getCurator

public Person getCurator()
Specified by:
getCurator in interface AnnotatedObject

setCurator

public void setCurator(Person person)
Specified by:
setCurator in interface AnnotatedObject

setXrefs

public void setXrefs(java.util.Collection someXrefs)
Specified by:
setXrefs in interface AnnotatedObject

getXrefs

public java.util.Collection getXrefs()
Specified by:
getXrefs in interface AnnotatedObject

addXref

public void addXref(Xref aXref)
Adds an xref to the object. The xref will only be added if an equivalent xref is not yet part of the object.

Specified by:
addXref in interface AnnotatedObject

removeXref

public void removeXref(Xref xref)
Specified by:
removeXref in interface AnnotatedObject

setAliases

public void setAliases(java.util.Collection someAliases)
Specified by:
setAliases in interface AnnotatedObject

getAliases

public java.util.Collection getAliases()
Specified by:
getAliases in interface AnnotatedObject

addAlias

public void addAlias(Alias alias)
Adds an alias to the object. The alis will only be added if an equivalent alias is not yet part of the object.

Specified by:
addAlias in interface AnnotatedObject

removeAlias

public void removeAlias(Alias alias)
Specified by:
removeAlias in interface AnnotatedObject

setReferences

public void setReferences(java.util.Collection someReferences)
Specified by:
setReferences in interface AnnotatedObject

getReferences

public java.util.Collection getReferences()
Specified by:
getReferences in interface AnnotatedObject

addReference

public void addReference(Reference reference)
Specified by:
addReference in interface AnnotatedObject

removeReference

public void removeReference(Reference reference)
Specified by:
removeReference in interface AnnotatedObject

getCuratorAc

public java.lang.String getCuratorAc()
Specified by:
getCuratorAc in interface AnnotatedObject

setCuratorAc

public void setCuratorAc(java.lang.String ac)
Specified by:
setCuratorAc in interface AnnotatedObject

update

public AnnotatedObject update(IntactHelper helper)
                       throws IntactException
Update an annotated object in the database. Ensure subobjects are updated appropriately.

Specified by:
update in interface AnnotatedObject
IntactException

updateUniqueAnnotation

public Annotation updateUniqueAnnotation(CvTopic topic,
                                         java.lang.String description,
                                         Institution owner)
Create or update an annotation. The anntation topic may only occur once in the object.

Specified by:
updateUniqueAnnotation in interface AnnotatedObject

equals

public boolean equals(java.lang.Object o)
Equality for AnnotatedObjects is currently based on equality for Xrefs, shortLabels and fullNames.

Specified by:
equals in interface AnnotatedObject
Overrides:
equals in class java.lang.Object
Parameters:
o - The object to check
Returns:
true if the parameter equals this object, false otherwise
See Also:
Xref

hashCode

public int hashCode()
This class overwrites equals. To ensure proper functioning of HashTable, hashCode must be overwritten, too.

Specified by:
hashCode in interface AnnotatedObject
Overrides:
hashCode in class java.lang.Object
Returns:
hash code of the object.

toString

public java.lang.String toString()
Specified by:
toString in interface AnnotatedObject
Overrides:
toString in class BasicObjectImpl


IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk