Package htsjdk.tribble.gff
Class Gff3Writer
- java.lang.Object
-
- htsjdk.tribble.gff.Gff3Writer
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class Gff3Writer extends Object implements Closeable
A class to write out gff3 files. Features are added usingaddFeature(Gff3Feature)
, directives usingaddDirective(Gff3Codec.Gff3Directive)
, and comments usingaddComment(String)
. Note that the version 3 directive is automatically added at creation, so should not be added separately.
-
-
Constructor Summary
Constructors Constructor Description Gff3Writer(OutputStream stream)
Gff3Writer(Path path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComment(String comment)
Add comment linevoid
addDirective(Gff3Codec.Gff3Directive directive)
Add a directivevoid
addDirective(Gff3Codec.Gff3Directive directive, Object object)
Add a directive with an objectvoid
addFeature(Gff3Feature feature)
add a featurevoid
close()
-
-
-
Constructor Detail
-
Gff3Writer
public Gff3Writer(Path path) throws IOException
- Throws:
IOException
-
Gff3Writer
public Gff3Writer(OutputStream stream)
-
-
Method Detail
-
addFeature
public void addFeature(Gff3Feature feature) throws IOException
add a feature- Parameters:
feature
- the feature to be added- Throws:
IOException
-
addDirective
public void addDirective(Gff3Codec.Gff3Directive directive, Object object) throws IOException
Add a directive with an object- Parameters:
directive
- the directive to be addedobject
- the object to be encoded with the directive- Throws:
IOException
-
addDirective
public void addDirective(Gff3Codec.Gff3Directive directive) throws IOException
Add a directive- Parameters:
directive
- the directive to be added- Throws:
IOException
-
addComment
public void addComment(String comment) throws IOException
Add comment line- Parameters:
comment
- the comment line (not including leading #)- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-