public class IntArrayFingerprint extends Object implements IBitFingerprint
Constructor and Description |
---|
IntArrayFingerprint() |
IntArrayFingerprint(IBitFingerprint fingerprint) |
IntArrayFingerprint(int[] setBits) |
IntArrayFingerprint(Map<String,Integer> rawFingerPrint) |
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.
|
void |
and(IntArrayFingerprint 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 |
or(IntArrayFingerprint fingerprint) |
void |
set(int i)
Sets the bit at the specified index to true.
|
void |
set(int index,
boolean value)
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 IntArrayFingerprint(int[] setBits)
public IntArrayFingerprint()
public IntArrayFingerprint(IBitFingerprint fingerprint)
public int cardinality()
IBitFingerprint
cardinality
in interface IBitFingerprint
public long size()
IBitFingerprint
size
in interface IBitFingerprint
public void and(IBitFingerprint fingerprint)
IBitFingerprint
true
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 IBitFingerprint
fingerprint
- the fingerprint with which to perform the AND operationpublic void and(IntArrayFingerprint fingerprint)
public void or(IBitFingerprint fingerprint)
IBitFingerprint
true
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 IBitFingerprint
fingerprint
- the fingerprint with which to perform the OR operationpublic void or(IntArrayFingerprint fingerprint)
public boolean get(int index)
IBitFingerprint
true
if the bit with the index index
is currently set in this fingerprint; otherwise, the result
is false
.get
in interface IBitFingerprint
index
- the index of the bit to return the value forindex
public void set(int index, boolean value)
IBitFingerprint
set
in interface IBitFingerprint
index
- the index of the bit to changevalue
- the new value for the bit at position index
public BitSet asBitSet()
IBitFingerprint
BitSet
representation of the fingerprint.
This might take significantly more memory!asBitSet
in interface IBitFingerprint
BitSet
public void set(int i)
IBitFingerprint
set
in interface IBitFingerprint
i
- indexpublic int[] getSetbits()
IBitFingerprint
getSetbits
in interface IBitFingerprint
Copyright © 2021. All rights reserved.