GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DATA::AVERAGE::BOUNDED (3)

.ds Aq ’

NAME

Data::Average::Bounded - Data::Average With Bounded

CONTENTS

SYNOPSIS



  use Data::Average::Bounded;

  my $data = Data::Average::Bounded->new(max => 10);
  $data->add($_) for (1..100);

  print $data->avg; # 95 (avg of 90 .. 100)



DESCRIPTION

Data::Average::Bounded is a bounded version of Data::Average, which keeps the data size to a predefined size.

METHODS

new(max => CW$max)

Creates a new Data::Average::Bounded object, bounded by $max.

    add($value)

Adds a value to the Data::Average::Bounded set. If the data size exceeds the length specified by ’max’ given to the constructor, old elements are popped out of the set to keep the data size.

$value may either be an object that implements a method ’value()’ which returns a numerical representation of the object, or a simple scalar.

length()

avg()

Same as Data::Average.

AUTHOR

Copyright (c) 2006 Daisuke Maki <dmaki@cpan.org> All rights reserved.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DATA::AVERAGE::BOUNDED (3) 2007-11-14

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.