bit_vector 0.2.0

bit_vector #

Build Status

A pure Dart memory-efficient packed representation for bit arrays.

Examples #

import 'package:bit_vector/bit_vector.dart';

main() {
  BitVector v = new BitVector();
  v.set(68);
  print(v.get(68)); // true
  v.toggle(68);
  print(v.get(68)); // false
}

Changelog #

0.2.0 #

  • Add isEmpty and isNotEmpty getters
  • Add cardinality() method
  • Override hashCode and ==

0.1.0 #

  • Initial version

example/bit_vector_example.dart

// Copyright (c) 2016, kseo. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:bit_vector/bit_vector.dart';

main() {
  BitVector v = new BitVector();
  v.set(68);
  print(v.get(68)); // true
  v.toggle(68);
  print(v.get(68)); // false
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  bit_vector: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bit_vector/bit_vector.dart';
  
Awaiting analysis to complete.

Admin