Michael Shipper > Data-Range-Compare-Stream > Data::Range::Compare::Stream::Iterator::Consolidate::OverlapAsColumn

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

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Data::Range::Compare::Stream::Iterator::Consolidate::OverlapAsColumn - Consolidates by moving overlaps to new columns

SYNOPSIS ^

  use Data::Range::Compare::Stream::Iterator::File;
  use Data::Range::Compare::Stream;
  use Data::Range::Compare::Stream::Iterator::Consolidate::OverlapAsColumn;
  use Data::Range::Compare::Stream::Iterator::Compare::Asc;
  
  my $compare=new  Data::Range::Compare::Stream::Iterator::Compare::Asc();
  
  foreach my $file (qw(source_a.src source_b.src source_d.src source_c.src source_d.src)) {
    my $src=Data::Range::Compare::Stream::Iterator::File->new(filename=>$file);
    my $con=new Data::Range::Compare::Stream::Iterator::Consolidate::OverlapAsColumn($src,$compare);
    $compare->add_consolidator($con);
  }
  
  my $format='  | %-12s | %-26s |  %-26s|  %-26s|  %-26s|'."\n";
  my $break="  +--------------+----------------------------+----------------------------+----------------------------+----------------------------+\n";
  printf "$break$format$break","Intersection","Set A",'Set B','Set C','Set D';
  
  while($compare->has_next) {
  
    my $result=$compare->get_next;
    next if $result->is_empty;
  
    my $columns=$result->get_root_results($result);
    my @row=($result->get_common);
    foreach my $id (@{$result->get_root_ids}) {
      if($#{$columns->[$id]}!=-1) {
        push @row, join ', ',map { $_->get_common } @{$columns->[$id]};
      } else {
        push @row,"No Data";
      }
    }
  
    printf $format,@row;
    print $break;
  }

DESCRIPTION ^

This module extends the consolidation engine for Data::Range::Compare::Stream. Unlike the default consolidation object this class does not merge ranges when they overlap: It creates additional instances of itself and inserts them into the "Compare" object. Each new object refers to the object that created it.

Data::Range::Compare::Stream::Iterator::Consolidate::OverlapAsColumn can consolidate ranges sorted in the following order:

Consolidation Asc range_start asc,range_end desc.

OO Methods

SEE ALSO ^

Data::Range::Compare::Stream::Iterator::Consolidate::OverlapAsColumn::Result

Data::Range::Compare::Stream::Iterator::Base

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: