Class IntArrayFingerprint
java.lang.Object
org.openscience.cdk.fingerprint.IntArrayFingerprint
- All Implemented Interfaces:
Serializable, IBitFingerprint
- Author:
- jonalv
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIntArrayFingerprint(int[] setBits) IntArrayFingerprint(Map<String, Integer> rawFingerPrint) IntArrayFingerprint(IBitFingerprint fingerprint) -
Method Summary
Modifier and TypeMethodDescriptionvoidand(IBitFingerprint fingerprint) Performs a logical AND of the bits in this target bit set with the bits in the argument fingerprint.voidand(IntArrayFingerprint fingerprint) asBitSet()Returns aBitSetrepresentation of the fingerprint.intReturns the number of bits set to true in the fingerprint.booleanbooleanget(int index) Returns the value of the bit with the specified index.int[]Returns a listing of the bits in the fingerprint that are set to true.inthashCode()voidor(IBitFingerprint fingerprint) Performs a logical OR of the bits in this target bit set with the bits in the argument fingerprint.voidor(IntArrayFingerprint fingerprint) voidset(int i) Sets the bit at the specified index to true.voidset(int index, boolean value) Sets the bit at the specified index to the specified value.longsize()Returns the size of the fingerprint, i.e., the number of hash bins.
-
Constructor Details
-
IntArrayFingerprint
-
IntArrayFingerprint
public IntArrayFingerprint(int[] setBits) -
IntArrayFingerprint
public IntArrayFingerprint() -
IntArrayFingerprint
-
-
Method Details
-
cardinality
public int cardinality()Description copied from interface:IBitFingerprintReturns the number of bits set to true in the fingerprint.- Specified by:
cardinalityin interfaceIBitFingerprint- Returns:
- the number of true bits.
-
size
public long size()Description copied from interface:IBitFingerprintReturns the size of the fingerprint, i.e., the number of hash bins.- Specified by:
sizein interfaceIBitFingerprint- Returns:
- the size of the fingerprint.
-
and
Description copied from interface:IBitFingerprintPerforms a logical AND of the bits in this target bit set with the bits in the argument fingerprint. This fingerprint is modified so that each bit in it has the valuetrueif and only if it both initially had the valuetrueand the corresponding bit in the fingerprint argument also had the valuetrue.- Specified by:
andin interfaceIBitFingerprint- Parameters:
fingerprint- the fingerprint with which to perform the AND operation
-
and
-
or
Description copied from interface:IBitFingerprintPerforms a logical OR of the bits in this target bit set with the bits in the argument fingerprint. This operation can also be seen as merging two fingerprints. This fingerprint is modified so that each bit in it has the valuetrueif and only if it either already had the valuetrueor the corresponding bit in the bit set argument has the valuetrue.- Specified by:
orin interfaceIBitFingerprint- Parameters:
fingerprint- the fingerprint with which to perform the OR operation
-
or
-
get
public boolean get(int index) Description copied from interface:IBitFingerprintReturns the value of the bit with the specified index. The value istrueif the bit with the indexindexis currently set in this fingerprint; otherwise, the result isfalse.- Specified by:
getin interfaceIBitFingerprint- Parameters:
index- the index of the bit to return the value for- Returns:
- the value of the bit at
index
-
set
public void set(int index, boolean value) Description copied from interface:IBitFingerprintSets the bit at the specified index to the specified value.- Specified by:
setin interfaceIBitFingerprint- Parameters:
index- the index of the bit to changevalue- the new value for the bit at positionindex
-
asBitSet
Description copied from interface:IBitFingerprintReturns aBitSetrepresentation of the fingerprint. This might take significantly more memory!- Specified by:
asBitSetin interfaceIBitFingerprint- Returns:
- the fingerprint as a
BitSet
-
set
public void set(int i) Description copied from interface:IBitFingerprintSets the bit at the specified index to true.- Specified by:
setin interfaceIBitFingerprint- Parameters:
i- index
-
hashCode
-
equals
-
getSetbits
public int[] getSetbits()Description copied from interface:IBitFingerprintReturns a listing of the bits in the fingerprint that are set to true.- Specified by:
getSetbitsin interfaceIBitFingerprint- Returns:
- listing of all bits that are set
-