Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Large Bit Set for Java
Java Shell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
src
.gitignore
README.textile
local-deploy.sh
pom.xml

README.textile

LargeBitSet

Bit set implementation to support bit sets in Java with a Long.MAX_VALUE number of bits. java.util.BitSet uses an int for addressing bits, this limits the number of bits to 2^31.

The implementation uses a list of BitSet objects to store the bits and performs an offset calculation to manage the bits. This allows the implementation to be pure Java, though a native implementation (C/JNI) would be more efficient in both memory and time.

Usage

import com.github.kyleburton.JBit;

public class Example {
  public static void main (String [] args ) {
    JBit bitSet = new JBit();
    bitSet.set( 2L * (long)Integer.MAX_VALUE );
    for (int ii = -5; ii <= 5; ++ii ) {
      long jj = (long)ii + (2L * (long)Integer.MAX_VALUE);
      System.out.println("set?[" + ii + "/" + jj + "]" + bitSet.get(jj));
    }
  }
}

Maven Repository

<repositories>
    <repository>
        <id>kyleburton-releases</id>
        <url>https://github.com/kyleburton/kyleburton-mvn-repo/raw/master/releases</url>
    </repository>
</repositories>

<!-- or -->
<repositories>
    <repository>
        <id>kyleburton-snapshots</id>
        <url>https://github.com/kyleburton/kyleburton-mvn-repo/raw/master/snapshots</url>
    </repository>
</repositories>
  :repositories {"kyleburton-releases" "https://github.com/kyleburton/kyleburton-mvn-repo/raw/master/releases/"}
  ;; or:
  :repositories {"kyleburton-snapshots" "https://github.com/kyleburton/kyleburton-mvn-repo/raw/master/snapshots/"}

Leiningen

   [com.github.kyleburton/JBit "1.0.0"]

Maven

  <dependencies>

    <dependency>
      <groupId>com.github.kyleburton</groupId>
      <artifactId>JBit</artifactId>
      <version>1.0.0</version>
    </dependency>

    ...

  </dependencies>

License

Copyright © 2011 RelayNetwork

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.