Skip to content

Commit 332852a

Browse files
committed
Expose internal values for serialization.
1 parent dde1d88 commit 332852a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/src/bit_counter.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ class BitCounter {
77

88
BitCounter(this._length);
99

10+
/// The list of bits from LSB to MSB.
11+
///
12+
/// Exposed only for serialization, do NOT call or modify them directly.
13+
List<BitArray> get bits => _bits;
14+
1015
/// The maximum number of bits required to store the value of the counter.
1116
int get bitLength => _bits.length;
1217

lib/src/bit_set.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class ListSet implements BitSet {
5858

5959
ListSet.fromSorted(this._list);
6060

61+
/// The list of values, in a sorted order.
62+
///
63+
/// Exposed only for serialization, do NOT call or modify them directly.
64+
List<int> get values => _list;
65+
6166
@override
6267
bool operator [](int index) {
6368
int left = 0;
@@ -102,6 +107,11 @@ class RangeSet implements BitSet {
102107

103108
RangeSet.fromSortedRangeLength(this._list);
104109

110+
/// The list of range+length encoded ranges, in a sorted order.
111+
///
112+
/// Exposed only for serialization, do NOT call or modify them directly.
113+
List<int> get rangeLengthValues => _list;
114+
105115
@override
106116
bool operator [](int index) {
107117
int left = 0;
@@ -207,4 +217,4 @@ List<int> _cloneList(List<int> list) {
207217
} else {
208218
return new List<int>.from(list);
209219
}
210-
}
220+
}

0 commit comments

Comments
 (0)