Releases: mbuchetics/RangeTree
Bugfix for Min/Max in Overlapping Intervals
Removed obsolete RangeTree code
With version 3.0.0 we now remove the obsolete RangeTree code to get a clean slate and have all classes be called IntervalTree. The only place, where RangeTree still appears is the package name and the git repository (which can't be changed, unless we create a completely new package).
Make sure to upgrade to 2.1.0 first and fix all compiler warnings, before upgrading to 3.0.0.
If you haven't used this project before, directly jump to this version.
Renamed RangeTree -> IntervalTree
This release contains a major name-refactoring and fixes the discrepancy between the conceptual interval tree that this package contains and the previous name RangeTree of the used classes, which is misleading. This update brings along a set of classes that are now called IntervalTree, while keeping all existing classes and only showing deprecation warnings when using the old RangeTree classes, along with instructions on how to transition to the new classes.
This version has no new features, so feel free to stay at version 2.0.1 if you prefer the name RangeTree or you do not want to spend time refactoring your codebase to fix the compiler warnings.
Upgrade to this version as an intermediate step before upgrading to 3.0.0 for a compiler-error free transition. This version will issue compiler warnings that you can simply fix by renaming the used classes as indicated by the warnings. As of 3.0.0, the RangeTree classes will disappear and break your code if you haven't transitioned to the new class name structure.
Bug-Fixes of (mostly) Copy-Paste errors
v2.0.1 Release of version 2.0.1 - Bugfixes of copy-paste errors. Thanks to J…
Major interface overhaul - 2.0.0
- Major interface-changes as proposed by Erik Domke.
- Removal of async tree
- Removal of public Rebuild-functionality (will be handled internally)
public interface IRangeTree<TKey, TValue>
: IEnumerable<RangeValuePair<TKey, TValue>>
{
IEnumerable<TValue> Values { get; }
int Count { get; }
IEnumerable<TValue> Query(TKey value);
IEnumerable<TValue> Query(TKey from, TKey to);
void Add(TKey from, TKey to, TValue value);
void Remove(TValue item);
void Remove(IEnumerable<TValue> items);
void Clear();
}
var tree = new RangeTree<int, string>()
{
{ 0, 10, "1" },
{ 20, 30, "2" },
{ 15, 17, "3" },
{ 25, 35, "4" },
};
// Add method:
tree.Add(0, 10, "1");
var results1 = tree.Query(5); // 1 item: [0 - 10]
var results2 = tree.Query(10); // 1 item: [0 - 10]
var results3 = tree.Query(29); // 2 items: [20 - 30], [25 - 35]
var results4 = tree.Query(5, 15); // 2 items: [0 - 10], [15 - 17]