diff options
author | Gianni Ceccarelli <dakkar@thenautilus.net> | 2011-11-14 14:47:03 +0000 |
---|---|---|
committer | Gianni Ceccarelli <dakkar@thenautilus.net> | 2011-11-14 14:47:03 +0000 |
commit | 389cd649f6b5a375d98889fec963d1ad31f4bf44 (patch) | |
tree | 4d77324dab5f9feaa4eeed204b494758dd6a9206 /lib/Data/MultiValued/Ranges.pm | |
parent | Build results of dd15e2e (on master) (diff) | |
parent | fix inserting range w/o overlap (diff) | |
download | data-multivalued-389cd649f6b5a375d98889fec963d1ad31f4bf44.tar.gz data-multivalued-389cd649f6b5a375d98889fec963d1ad31f4bf44.tar.bz2 data-multivalued-389cd649f6b5a375d98889fec963d1ad31f4bf44.zip |
Build results of dd15e2e (on master)
Diffstat (limited to 'lib/Data/MultiValued/Ranges.pm')
-rw-r--r-- | lib/Data/MultiValued/Ranges.pm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/Data/MultiValued/Ranges.pm b/lib/Data/MultiValued/Ranges.pm index ef55b4c..296ae76 100644 --- a/lib/Data/MultiValued/Ranges.pm +++ b/lib/Data/MultiValued/Ranges.pm @@ -74,6 +74,7 @@ sub clear { $self->_storage->clear(\%args); } + 1; __END__ @@ -108,7 +109,10 @@ version 0.0.1 Stores the given value for the given range. Does not throw exceptions. -The range is defined as C<< Num $x : $min <= $x < $max >>. +The range is defined as C<< Num $x : $min <= $x < $max >>. A C<< from +=> undef >> means "from -Inf", and a C<< to => undef >> means "to ++Inf". Not passing in C<from> or C<to> is equivalent to passing +C<undef>. If the given range intersects existing ranges, these are spliced to avoid overlaps. In other words: @@ -139,6 +143,9 @@ L<Data::MultiValued::Exceptions::RangeNotFound> exception if no ranges exist in this object that include the point (remember that a range does not include its C<to> point). +A C<< at => undef >> means "at -Inf". Not passing in C<at> is +equivalent to passing C<undef>. + No cloning is done: if a reference was stored, you get it back untouched. @@ -148,6 +155,10 @@ untouched. Deletes all values for the given range. Does not throw exceptions. +A C<< from => undef >> means "from -Inf", and a C<< to => undef >> +means "to +Inf". Not passing in C<from> or C<to> is equivalent to +passing C<undef>. Thus, C<< $obj->clear() >> clears everything. + If the given range intersects existing ranges, these are spliced. In other words: @@ -163,6 +174,10 @@ other words: say $obj->get({at => 12}); # prints 'foo' say $obj->get({at => 15}); # dies +=head1 SEE ALSO + +L<Data::MultiValued::RangeContainer>, L<Data::MultiValued::Exceptions> + =head1 AUTHOR Gianni Ceccarelli <dakkar@thenautilus.net> |