class Bio::FlatFile::Splitter::Template
This is a template of splitter.
Attributes
the last entry string read from the stream (String)
(end position of the entry) + 1
a flag to write down entry start and end positions
start position of the entry
The last parsed entry read from the stream (entry data class). Note that it is valid only after get_parsed_entry
is called, and the get_entry
may not affect the parsed_entry
attribute.
Public Class Methods
Source
# File lib/bio/io/flatfile/splitter.rb 31 def initialize(klass, bstream) 32 @dbclass = klass 33 @stream = bstream 34 @entry_pos_flag = nil 35 end
Creates a new splitter.
Public Instance Methods
Source
# File lib/bio/io/flatfile/splitter.rb 48 def get_entry 49 raise NotImplementedError 50 end
Gets entry as a string. (String)
Source
# File lib/bio/io/flatfile/splitter.rb 53 def get_parsed_entry 54 ent = get_entry 55 if ent then 56 self.parsed_entry = dbclass.new(ent) 57 else 58 self.parsed_entry = ent 59 end 60 parsed_entry 61 end
Gets entry as a data class’s object
Source
# File lib/bio/io/flatfile/splitter.rb 43 def rewind 44 @stream.rewind 45 end
rewind the stream
Source
# File lib/bio/io/flatfile/splitter.rb 38 def skip_leader 39 raise NotImplementedError 40 end
skips leader of the entry.