NAME
Tree::Range::RB::Conflict – range tree implemented on top of Tree::RB, which fails instead of writing over
SYNOPSIS
require Tree::Range::RB::Conflict;
sub ncmp { $_[0] <=> $_[1]; }
my $nrt
= Tree::Range::RB->new ({ "cmp" => \&ncmp });
$nrt->range_set (100, 200, "foo");
$nrt->range_set (200, 300, "bar");
## this last range_set () raises an exception
$nrt->range_set (150, 250, "baz");
DESCRIPTION
This class implements a range tree (as described in Tree::Range::base) on top of the Tree::RB red-black tree implementation, with the ranges being “overwrite-protected” (as described in Tree::Range::conflict.)
It inherits from both Tree::Range::RB and Tree::Range::conflict. Please refer to the Tree::Range::RB documentation for additional information and examples.
Note that the range_set_over
method remains available, so it’s still possible to overwrite an arbitrary range’s association, or to effectively “remove” one (by associating it with the leftmost value.)
SEE ALSO
Tree::Range::RB, Tree::Range::base, Tree::Range::conflict.
AUTHOR
Ivan Shmakov <oneingray@gmail.com>
This library is free software; you can redistribute it and/or modify it under the terms of the 3-clause BSD license, as included within the code.