public class SplitSequenceAnnotationParser extends Object implements SequenceAnnotationParser
SequenceAnnotationParser
which simply splits the comments by specific delimiters.Modifier and Type | Field and Description |
---|---|
protected LinkedList<SequenceAnnotation> |
annot
The internal list of current
SequenceAnnotation s. |
protected String |
annotationDelimiter
The delimiter between different annotations
|
protected String |
keyValueDelimiter
The delimiter between key and value
|
Constructor and Description |
---|
SplitSequenceAnnotationParser()
Creates a new
SplitSequenceAnnotationParser with specific delimiters, i.e., key value
delimiter "=" and annotation delimiter ";". |
SplitSequenceAnnotationParser(String keyValueDelimiter,
String annotationDelimiter)
Creates a new
SplitSequenceAnnotationParser with user-specified delimiters. |
Modifier and Type | Method and Description |
---|---|
protected void |
add(String type,
String identifier)
This method actually adds a
SequenceAnnotation to the internal list. |
void |
addToAnnotation(String unparsed)
|
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
SequenceAnnotation s that can be used as comment line in a file. |
protected String keyValueDelimiter
protected String annotationDelimiter
protected LinkedList<SequenceAnnotation> annot
SequenceAnnotation
s.public SplitSequenceAnnotationParser()
SplitSequenceAnnotationParser
with specific delimiters, i.e., key value
delimiter "=" and annotation delimiter ";".public SplitSequenceAnnotationParser(String keyValueDelimiter, String annotationDelimiter)
SplitSequenceAnnotationParser
with user-specified delimiters.keyValueDelimiter
- the delimiter between key and corresponding valueannotationDelimiter
- the delimiter between different SequenceAnnotation
sIllegalArgumentException
- if the delimiters are identicalpublic void addToAnnotation(String unparsed)
SequenceAnnotationParser
addToAnnotation
in interface SequenceAnnotationParser
unparsed
- the String containing the annotationprotected void add(String type, String identifier)
SequenceAnnotation
to the internal list.type
- the type of the SequenceAnnotation
identifier
- the identifier of the SequenceAnnotation
public void clearAnnotation()
SequenceAnnotationParser
SequenceAnnotation
.clearAnnotation
in interface SequenceAnnotationParser
public SequenceAnnotation[] getCurrentAnnotation()
SequenceAnnotationParser
SequenceAnnotation
.getCurrentAnnotation
in interface SequenceAnnotationParser
SequenceAnnotation
public String parseAnnotationToComment(char commentChar, SequenceAnnotation... annotations)
SequenceAnnotationParser
String
representation of the given
SequenceAnnotation
s that can be used as comment line in a file.
SequenceAnnotationParser.addToAnnotation(String)
.parseAnnotationToComment
in interface SequenceAnnotationParser
commentChar
- the char at the beginning of comment linesannotations
- the SequenceAnnotation
s to be parsedSequenceAnnotation
sDataSet.save(java.io.OutputStream, char, SequenceAnnotationParser)