forked from lemire/sparsebitmap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
61 lines (38 loc) · 1.19 KB
/
README
File metadata and controls
61 lines (38 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
SparseBitmap
(c) 2012
Daniel Lemire (http://lemire.me/en/),
A simple sparse bitmap implementation that has good performance.
Licensing: Apache License, Version 2.0
Usage:
public static void main(String[] args) {
SparseBitmap sp1 = SparseBitmap.bitmapOf(1, 2, 100, 150, 1000, 123456);
for (int i : sp1)
System.out.print(i + " ");
System.out.println();
SparseBitmap sp2 = SparseBitmap.bitmapOf(1, 2, 3, 1000, 123456, 1234567);
for (int i : sp2)
System.out.print(i + " ");
System.out.println();
SparseBitmap sand = sp1.and(sp2);
System.out.println("and:");
for (int i : sand)
System.out.print(i + " ");
System.out.println();
SparseBitmap sor = sp1.or(sp2);
System.out.println("or:");
for (int i : sor)
System.out.print(i + " ");
System.out.println();
}
Maven support:
You can also specify the dependency in the Maven "pom.xml" file:
{{{
<dependencies>
<dependency>
<groupId>com.googlecode.sparsebitmap</groupId>
<artifactId>SparseBitmap</artifactId>
<version>0.0.2</version>
</dependency>
</dependencies>
}}}
Make sure to replace the version number with the version you actually want.