public class BitSetFingerprint extends Object implements IBitFingerprint
| Constructor and Description |
|---|
BitSetFingerprint() |
BitSetFingerprint(BitSet bitset) |
BitSetFingerprint(IBitFingerprint fingerprint) |
BitSetFingerprint(int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
and(IBitFingerprint fingerprint)
Performs a logical AND of the bits in this target bit set with
the bits in the argument fingerprint.
|
BitSet |
asBitSet()
Returns a
BitSet representation of the fingerprint. |
int |
cardinality()
Returns the number of bits set to true in the fingerprint.
|
boolean |
equals(Object obj) |
boolean |
get(int index)
Returns the value of the bit with the specified index.
|
int[] |
getSetbits()
Returns a listing of the bits in the fingerprint that are set to true.
|
int |
hashCode() |
void |
or(IBitFingerprint fingerprint)
Performs a logical OR of the bits in this target bit set with
the bits in the argument fingerprint.
|
void |
set(int i)
Sets the bit at the specified index to true.
|
void |
set(int index,
boolean b)
Sets the bit at the specified index to the specified value.
|
long |
size()
Returns the size of the fingerprint, i.e., the number of hash bins.
|
public BitSetFingerprint(BitSet bitset)
public BitSetFingerprint()
public BitSetFingerprint(int size)
public BitSetFingerprint(IBitFingerprint fingerprint)
public int cardinality()
IBitFingerprintcardinality in interface IBitFingerprintpublic long size()
IBitFingerprintsize in interface IBitFingerprintpublic void and(IBitFingerprint fingerprint)
IBitFingerprinttrue if and only if
it both initially had the value true and the
corresponding bit in the fingerprint argument also had the value
true.and in interface IBitFingerprintfingerprint - the fingerprint with which to perform the AND operationpublic void or(IBitFingerprint fingerprint)
IBitFingerprinttrue if and only if
it either already had the value true or the corresponding
bit in the bit set argument has the value true.or in interface IBitFingerprintfingerprint - the fingerprint with which to perform the OR operationpublic boolean get(int index)
IBitFingerprinttrue if the bit with the index index
is currently set in this fingerprint; otherwise, the result
is false.get in interface IBitFingerprintindex - the index of the bit to return the value forindexpublic void set(int index,
boolean b)
IBitFingerprintset in interface IBitFingerprintindex - the index of the bit to changeb - the new value for the bit at position indexpublic BitSet asBitSet()
IBitFingerprintBitSet representation of the fingerprint.
This might take significantly more memory!asBitSet in interface IBitFingerprintBitSetpublic void set(int i)
IBitFingerprintset in interface IBitFingerprinti - indexpublic int[] getSetbits()
IBitFingerprintgetSetbits in interface IBitFingerprintCopyright © 2017. All Rights Reserved.