fern.network.fernml
Class FernMLAnnotationManager

java.lang.Object
  extended by fern.network.fernml.FernMLAnnotationManager
All Implemented Interfaces:
AnnotationManager

public class FernMLAnnotationManager
extends Object
implements AnnotationManager

AnnotationManager for FernMLNetworks. The data is not copied but maintained within the tree (which should not be an efficiency issue except you want to use the annotations to store user data of reactions / species and do this very excessive - so don't do that). This avoids problems when saving the FernMLNetwork again.

Author:
Florian Erhard

Constructor Summary
FernMLAnnotationManager(org.jdom.Element rootElement)
          Create the AnnotationManager from the root element of the jdom tree.
 
Method Summary
 boolean containsNetworkAnnotation(String typ)
          Returns true iff the network contains an annotation of the specified type.
 boolean containsReactionAnnotation(int reaction, String typ)
          Returns true iff the reaction contains an annotation of the specified type.
 boolean containsSpeciesAnnotation(int species, String typ)
          Returns true iff the species contains an annotation of the specified type.
 String getNetworkAnnotation(String typ)
          Gets the network annotation of the specified field.
 Collection<String> getNetworkAnnotationTypes()
          Gets the names of the network reaction.
 String getReactionAnnotation(int reaction, String typ)
          Gets the reaction annotation of the specified field.
 Collection<String> getReactionAnnotationTypes(int reaction)
          Gets the names of the species reaction.
 String getSpeciesAnnotation(int species, String typ)
          Gets the species annotation of the specified field.
 Collection<String> getSpeciesAnnotationTypes(int species)
          Gets the names of the species annotations.
 void setNetworkAnnotation(String typ, String annotation)
          Sets the network annotation of the specified field.
 void setReactionAnnotation(int reaction, String typ, String annotation)
          Sets the reaction annotation of the specified field.
 void setSpeciesAnnotation(int species, String typ, String annotation)
          Sets the species annotation of the specified field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FernMLAnnotationManager

public FernMLAnnotationManager(org.jdom.Element rootElement)
Create the AnnotationManager from the root element of the jdom tree.

Parameters:
rootElement - the root element of the jdom tree
Method Detail

containsNetworkAnnotation

public boolean containsNetworkAnnotation(String typ)
Description copied from interface: AnnotationManager
Returns true iff the network contains an annotation of the specified type.

Specified by:
containsNetworkAnnotation in interface AnnotationManager
Parameters:
typ - field name of the annotation
Returns:
true iff such an annotation is present

getNetworkAnnotation

public String getNetworkAnnotation(String typ)
Description copied from interface: AnnotationManager
Gets the network annotation of the specified field.

Specified by:
getNetworkAnnotation in interface AnnotationManager
Parameters:
typ - name of the field
Returns:
network annotation

getNetworkAnnotationTypes

public Collection<String> getNetworkAnnotationTypes()
Description copied from interface: AnnotationManager
Gets the names of the network reaction.

Specified by:
getNetworkAnnotationTypes in interface AnnotationManager
Returns:
names of the fields

setNetworkAnnotation

public void setNetworkAnnotation(String typ,
                                 String annotation)
Description copied from interface: AnnotationManager
Sets the network annotation of the specified field.

Specified by:
setNetworkAnnotation in interface AnnotationManager
Parameters:
typ - name of the field
annotation - network annotation

containsReactionAnnotation

public boolean containsReactionAnnotation(int reaction,
                                          String typ)
Description copied from interface: AnnotationManager
Returns true iff the reaction contains an annotation of the specified type.

Specified by:
containsReactionAnnotation in interface AnnotationManager
Parameters:
reaction - index of the reaction
typ - field name of the annotation
Returns:
true iff such an annotation is present

getReactionAnnotation

public String getReactionAnnotation(int reaction,
                                    String typ)
Description copied from interface: AnnotationManager
Gets the reaction annotation of the specified field.

Specified by:
getReactionAnnotation in interface AnnotationManager
Parameters:
reaction - index of the reaction
typ - name of the field
Returns:
reaction annotation

getReactionAnnotationTypes

public Collection<String> getReactionAnnotationTypes(int reaction)
Description copied from interface: AnnotationManager
Gets the names of the species reaction.

Specified by:
getReactionAnnotationTypes in interface AnnotationManager
Parameters:
reaction - index of the reaction
Returns:
names of the fields

setReactionAnnotation

public void setReactionAnnotation(int reaction,
                                  String typ,
                                  String annotation)
Description copied from interface: AnnotationManager
Sets the reaction annotation of the specified field.

Specified by:
setReactionAnnotation in interface AnnotationManager
Parameters:
reaction - index of the reaction
typ - name of the field
annotation - reaction annotation

containsSpeciesAnnotation

public boolean containsSpeciesAnnotation(int species,
                                         String typ)
Description copied from interface: AnnotationManager
Returns true iff the species contains an annotation of the specified type.

Specified by:
containsSpeciesAnnotation in interface AnnotationManager
Parameters:
species - index of the species
typ - field name of the annotation
Returns:
true iff such an annotation is present

getSpeciesAnnotation

public String getSpeciesAnnotation(int species,
                                   String typ)
Description copied from interface: AnnotationManager
Gets the species annotation of the specified field.

Specified by:
getSpeciesAnnotation in interface AnnotationManager
Parameters:
species - index of the species
typ - name of the field
Returns:
species annotation

getSpeciesAnnotationTypes

public Collection<String> getSpeciesAnnotationTypes(int species)
Description copied from interface: AnnotationManager
Gets the names of the species annotations.

Specified by:
getSpeciesAnnotationTypes in interface AnnotationManager
Parameters:
species - index of the species
Returns:
names of the fields

setSpeciesAnnotation

public void setSpeciesAnnotation(int species,
                                 String typ,
                                 String annotation)
Description copied from interface: AnnotationManager
Sets the species annotation of the specified field.

Specified by:
setSpeciesAnnotation in interface AnnotationManager
Parameters:
species - index of the species
typ - name of the field
annotation - species annotation