de.jstacs.data.sequences.annotation
Class SimpleSequenceAnnotationParser

java.lang.Object
  extended by de.jstacs.data.sequences.annotation.SimpleSequenceAnnotationParser
All Implemented Interfaces:
SequenceAnnotationParser

public class SimpleSequenceAnnotationParser
extends Object
implements SequenceAnnotationParser

This class implements a naive SequenceAnnotationParser which simply paste the comments into SequenceAnnotation.

Author:
Jens Keilwagen

Constructor Summary
SimpleSequenceAnnotationParser()
          The constructor of a SimpleSequenceAnnotationParser which simply paste the comments into SequenceAnnotation.
 
Method Summary
 void addToAnnotation(String unparsed)
          This method adds the unparsed String in some way to the SequenceAnnotation.
 void clearAnnotation()
          This method reset the current SequenceAnnotation.
 SequenceAnnotation[] getCurrentAnnotation()
          This method returns the current SequenceAnnotation.
 String parseAnnotationToComment(char commentChar, SequenceAnnotation... annotations)
          This method returns a String representation of the given SequenceAnnotations that can be used as comment line in a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSequenceAnnotationParser

public SimpleSequenceAnnotationParser()
The constructor of a SimpleSequenceAnnotationParser which simply paste the comments into SequenceAnnotation.

Method Detail

addToAnnotation

public void addToAnnotation(String unparsed)
Description copied from interface: SequenceAnnotationParser
This method adds the unparsed String in some way to the SequenceAnnotation.

Specified by:
addToAnnotation in interface SequenceAnnotationParser
Parameters:
unparsed - the String containing the annotation

clearAnnotation

public void clearAnnotation()
Description copied from interface: SequenceAnnotationParser
This method reset the current SequenceAnnotation.

Specified by:
clearAnnotation in interface SequenceAnnotationParser

getCurrentAnnotation

public SequenceAnnotation[] getCurrentAnnotation()
Description copied from interface: SequenceAnnotationParser
This method returns the current SequenceAnnotation.

Specified by:
getCurrentAnnotation in interface SequenceAnnotationParser
Returns:
the current SequenceAnnotation

parseAnnotationToComment

public String parseAnnotationToComment(char commentChar,
                                       SequenceAnnotation... annotations)
Description copied from interface: SequenceAnnotationParser
This method returns a String representation of the given SequenceAnnotations that can be used as comment line in a file.
Normally, the method should do the opposite of SequenceAnnotationParser.addToAnnotation(String).

Specified by:
parseAnnotationToComment in interface SequenceAnnotationParser
Parameters:
commentChar - the char at the beginning of comment lines
annotations - the SequenceAnnotations to be parsed
Returns:
a String representing the given SequenceAnnotations
See Also:
DataSet.save(java.io.OutputStream, char, SequenceAnnotationParser)