anvil.annot
Interface Annotation


public interface Annotation


Method Summary
 void addObserver(java.util.Observer obs)
          Adds observer object to annotation which receives an update call each time the annotation is changed.
 anvil.annot.AnnotationNode getAnnotationNode(java.lang.String name)
          Returns annotation node with name if it exists, null otherwise.
 java.util.AbstractList getNodes()
          Returns list of all annotation nodes.
 java.io.File getPath()
           
 anvil.annot.AnnotationProperties getProperties()
           
 anvil.annot.GroupNode getRoot()
          Returns the group node that lies at the top of the track/group hierarchy.
 anvil.annot.meta.SessionData getSessionData()
          Returns session meta-data.
 anvil.annot.AnnotationSpec getSpec()
          Returns annotation specification object.
 anvil.annot.Track getTrack(java.lang.String name)
          Returns track with name name if it exists, null otherwise.
 java.util.LinkedList getTracks()
          Returns a list of all (non-static) tracks.
 boolean hasWaveform()
          Returns whether the annotation contains a waveform.
 boolean isModified()
          Returns whether the annotation has been modified since the last save.
 anvil.annot.AnnotationNode makeTrack(anvil.annot.GroupNode parent, anvil.annot.ContainerSpec tspec)
          Creates and adds track according to the given specification.
 void print()
          Prints contents of all groups and tracks to standard output.
 void setModified(boolean mod)
          Sets the modified flag.
 void writeAnvilFile()
          Writes annotation to current file path in Anvil's XML format.
 

Method Detail

addObserver

public void addObserver(java.util.Observer obs)
Adds observer object to annotation which receives an update call each time the annotation is changed.


getAnnotationNode

public anvil.annot.AnnotationNode getAnnotationNode(java.lang.String name)
Returns annotation node with name if it exists, null otherwise.

Parameters:
name - full path name of desired node

getPath

public java.io.File getPath()

getProperties

public anvil.annot.AnnotationProperties getProperties()

getTrack

public anvil.annot.Track getTrack(java.lang.String name)
Returns track with name name if it exists, null otherwise.


getTracks

public java.util.LinkedList getTracks()
Returns a list of all (non-static) tracks.


getNodes

public java.util.AbstractList getNodes()
Returns list of all annotation nodes.


getRoot

public anvil.annot.GroupNode getRoot()
Returns the group node that lies at the top of the track/group hierarchy.


getSessionData

public anvil.annot.meta.SessionData getSessionData()
Returns session meta-data.


getSpec

public anvil.annot.AnnotationSpec getSpec()
Returns annotation specification object.


hasWaveform

public boolean hasWaveform()
Returns whether the annotation contains a waveform.


isModified

public boolean isModified()
Returns whether the annotation has been modified since the last save.


makeTrack

public anvil.annot.AnnotationNode makeTrack(anvil.annot.GroupNode parent,
                                            anvil.annot.ContainerSpec tspec)
Creates and adds track according to the given specification.

Parameters:
tspec - track specification object
Returns:
new track

print

public void print()
Prints contents of all groups and tracks to standard output.


setModified

public void setModified(boolean mod)
Sets the modified flag.


writeAnvilFile

public void writeAnvilFile()
                    throws anvil.annot.AnnotationException,
                           java.io.IOException
Writes annotation to current file path in Anvil's XML format. Note that this will not clear the modified flag. The user has to see to that.

anvil.annot.AnnotationException
java.io.IOException