Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kseo/range_collection
A collection library for range.
https://github.com/kseo/range_collection
Last synced: 26 days ago
JSON representation
A collection library for range.
- Host: GitHub
- URL: https://github.com/kseo/range_collection
- Owner: kseo
- License: bsd-3-clause
- Created: 2015-11-02T01:46:16.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-09T10:27:06.000Z (almost 9 years ago)
- Last Synced: 2023-08-20T22:59:38.501Z (about 1 year ago)
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/range_collection
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# range_collection
A collection library for Range data type. This project is heavily inspired by Guava's [Range][range], [RangeSet][rangeset] and [RangeMap][rangemap] classes.
[![Build Status](https://travis-ci.org/kseo/range_collection.svg)](https://travis-ci.org/kseo/range_collection)
[![Coverage Status](https://coveralls.io/repos/kseo/range_collection/badge.svg?branch=master&service=github)](https://coveralls.io/github/kseo/range_collection?branch=master)[range]: https://github.com/google/guava/wiki/RangesExplained
[rangeset]: https://github.com/google/guava/wiki/NewCollectionTypesExplained#rangeset
[rangemap]: https://github.com/google/guava/wiki/NewCollectionTypesExplained#rangemap## Usage
A simple usage example:
```dart
library range_collection.example;import 'package:range_collection/range_collection.dart';
main() {
RangeSet rangeSet = new SkipListRangeSet();
rangeSet.add(new Range.closed(1, 10));
print(rangeSet); // {[1, 10]}rangeSet.add(new Range.closedOpen(11, 15));
print(rangeSet); // disconnected range; {[1, 10], [11, 15)}rangeSet.add(new Range.closedOpen(15, 20));
print(rangeSet); // connected range; {[1, 10], [11, 20)}rangeSet.add(new Range.openClosed(0, 0));
print(rangeSet); // empty range; {[1, 10], [11, 20)}rangeSet.remove(new Range.open(5, 10));
print(rangeSet); // splits [1, 10]; {[1, 5], [10, 10], [11, 20)}}
}
```## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/kseo/range_collection/issues