Bio::DB::GFF::Adaptor memory_iterator
Package variablesGeneral documentationMethods
Package variables
No package variables defined.
Synopsis
No synopsis!
Description
No description!
Methods
new
No description
Code
next_feature
No description
Code
Methods description
None available.
Methods code
newdescriptionprevnextTop
sub new {
  my $class = shift;
  my ($data,$callback) = @_;
  my $pos = 0;
  return bless {data     => $data,
		pos      => $pos,
		callback => $callback,
                cache    => []},$class;
  #return bless [$sth,$callback,[]],$class;
}
next_featuredescriptionprevnextTop
sub next_feature {
  my $self = shift;
  return shift @{$self->{cache}} if @{$self->{cache}};
  my $data = $self->{data} or return;
  my $next_feature_pos = $self->{pos}; 
  my $callback = $self->{callback};

  my $features;
  while (1) {
    #if (my $feature = $self->{data}[$next_feature_pos]) {
if ($next_feature_pos < @{$self->{data}}){ my $feature = $self->{data}[$next_feature_pos]; $features = $callback->(@{$feature}); $self->{pos}++; last if $features; } else { undef $self->{pos}; undef $self->{data}; $features = $callback->(); #last;
return; } } #return $features;
$self->{cache} = $features or return; shift @{$self->{cache}};
}
General documentation
No general documentation available.