Michael Shipper > Data-Range-Compare-Stream-4.029 > Data::Range::Compare::Stream::Iterator::Consolidate::FillMissing

Download:
Data-Range-Compare-Stream-4.029.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Data::Range::Compare::Stream::Iterator::Consolidate::FillMissing - Post Consolidation Iterator used to fill gaps

SYNOPSIS ^

  use Data::Range::Compare::Stream::Iterator::Consolidate;
  use Data::Range::Compare::Stream::Iterator::Array;
  use Data::Range::Compare::Stream;
  use Data::Range::Compare::Stream::Iterator::Consolidate::FillMissing;

  my $array=Data::Range::Compare::Stream::Iterator::Array->new;

  $array->create_range(0,0);
  $array->create_range(1,1);
  $array->create_range(3,4);
  $array->create_range(6,7);
  
  $array->set_sorted(1);

  my $con=Data::Range::Compare::Stream::Iterator::Consolidate->new($array);
  my $fill=new Data::Range::Compare::Stream::Iterator::Consolidate::FillMissing($con);

  while($fill->has_next) {
    my $result=$fill->get_next;
    my $missing=$result->is_missing ? ' Gap' : '';
    print $result,$missing,"\n";
  }

Resulting Output:

  Commoon Range: [0 - 0] Starting range: [0 - 0] Ending Range: [0 - 0]
  Commoon Range: [1 - 1] Starting range: [1 - 1] Ending Range: [1 - 1]
  Commoon Range: [2 - 2] Starting range: [2 - 2] Ending Range: [2 - 2] Gap
  Commoon Range: [3 - 4] Starting range: [3 - 4] Ending Range: [3 - 4]
  Commoon Range: [5 - 5] Starting range: [5 - 5] Ending Range: [5 - 5] Gap
  Commoon Range: [6 - 7] Starting range: [6 - 7] Ending Range: [6 - 7]

DESCRIPTION ^

This class Extends Data::Range::Compare::Stream::Iterator::Base. Any gaps in the input data set are filled in and marked as missing.

OO Methods

SEE ALSO ^

Data::Range::Compare::Stream::Cookbook

AUTHOR ^

Michael Shipper

Source-Forge Project ^

As of version 0.001 the Project has been moved to Source-Forge.net

Data Range Compare https://sourceforge.net/projects/data-range-comp/

COPYRIGHT ^

Copyright 2011 Michael Shipper. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: