TissueInfo API 20091124110011

edu.mssm.crover.representation
Class Annotations

java.lang.Object
  extended by edu.mssm.crover.representation.Annotations
All Implemented Interfaces:
BiologicalAnnotations, Serializable

public class Annotations
extends Object
implements BiologicalAnnotations, Serializable

Default implementation of BiologicalAnnotations. Stores the annotations attached to a sequence.

Author:
Fabien Campagne
See Also:
Serialized Form

Constructor Summary
Annotations()
           
 
Method Summary
 void addAnnotation(BiologicalAnnotation a)
          Adds an annotation to this list.
 Object findAnnotation(Class annotation_class)
          Finds and return an annotation according to its class.
 Object findAnnotation(Class annotation_class, int seq_pos)
          Finds and return an annotation about a residue, according to its class.
 BiologicalAnnotation[] getAnnotations()
          Returns these annotations as an array of BiologicalAnnotation.
 URL getResidueURL(int position)
          Returns the URL anchored to the residue at the index position.
static void main(String[] args)
          Tests various features of this class.
 boolean removeAnnotation(BiologicalAnnotation a)
          Removes an annotation from this list.
 String toString()
          Prints the content of this annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Annotations

public Annotations()
Method Detail

addAnnotation

public void addAnnotation(BiologicalAnnotation a)
Adds an annotation to this list. The annotation is added at the end of the list. The semantic of the order of annotation is not clearly defined at the moment.

Specified by:
addAnnotation in interface BiologicalAnnotations

removeAnnotation

public boolean removeAnnotation(BiologicalAnnotation a)
Removes an annotation from this list.

Specified by:
removeAnnotation in interface BiologicalAnnotations
Parameters:
a - the annotation to be removed.
Returns:
true if the argument was part of these annotations; false otherwise.

getAnnotations

public BiologicalAnnotation[] getAnnotations()
Returns these annotations as an array of BiologicalAnnotation. Do not modify the elements of the array unless you want to change the annotations: the elements are referenced, not cloned.

Specified by:
getAnnotations in interface BiologicalAnnotations

getResidueURL

public URL getResidueURL(int position)
Returns the URL anchored to the residue at the index position. The index is relative to the sequence these annotations are attached to. Returns null if no such URL_Annotation is described in the list.

Specified by:
getResidueURL in interface BiologicalAnnotations

findAnnotation

public Object findAnnotation(Class annotation_class)
Finds and return an annotation according to its class.

Specified by:
findAnnotation in interface BiologicalAnnotations
Returns:
The annotation that supports the interface required or null if none was found.

findAnnotation

public Object findAnnotation(Class annotation_class,
                             int seq_pos)
Finds and return an annotation about a residue, according to its class.

Parameters:
annotation_class - The class of the annotation to search for.
seq_pos - The position on the sequence that an annotation must describe to be returned.
Returns:
The annotation that supports the interface required or null if none was found.

toString

public String toString()
Prints the content of this annotation. The output is a default, every bit printed, text form.

Specified by:
toString in interface BiologicalAnnotations
Overrides:
toString in class Object

main

public static void main(String[] args)
Tests various features of this class.


TissueInfo API 20091124110011

Copyright © 2001-2009 Institute for Computational Biomedicine, All Rights Reserved.