Class IntArrayFingerprint

java.lang.Object
org.openscience.cdk.fingerprint.IntArrayFingerprint
All Implemented Interfaces:
Serializable, IBitFingerprint

public class IntArrayFingerprint extends Object implements IBitFingerprint
Author:
jonalv
See Also:
Source code:
main
Belongs to CDK module:
standard
  • Constructor Details

    • IntArrayFingerprint

      public IntArrayFingerprint(Map<String,Integer> rawFingerPrint)
    • IntArrayFingerprint

      public IntArrayFingerprint(int[] setBits)
    • IntArrayFingerprint

      public IntArrayFingerprint()
    • IntArrayFingerprint

      public IntArrayFingerprint(IBitFingerprint fingerprint)
  • Method Details

    • cardinality

      public int cardinality()
      Description copied from interface: IBitFingerprint
      Returns the number of bits set to true in the fingerprint.
      Specified by:
      cardinality in interface IBitFingerprint
      Returns:
      the number of true bits.
    • size

      public long size()
      Description copied from interface: IBitFingerprint
      Returns the size of the fingerprint, i.e., the number of hash bins.
      Specified by:
      size in interface IBitFingerprint
      Returns:
      the size of the fingerprint.
    • and

      public void and(IBitFingerprint fingerprint)
      Description copied from interface: IBitFingerprint
      Performs 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 value 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.
      Specified by:
      and in interface IBitFingerprint
      Parameters:
      fingerprint - the fingerprint with which to perform the AND operation
    • and

      public void and(IntArrayFingerprint fingerprint)
    • or

      public void or(IBitFingerprint fingerprint)
      Description copied from interface: IBitFingerprint
      Performs 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 value 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.
      Specified by:
      or in interface IBitFingerprint
      Parameters:
      fingerprint - the fingerprint with which to perform the OR operation
    • or

      public void or(IntArrayFingerprint fingerprint)
    • get

      public boolean get(int index)
      Description copied from interface: IBitFingerprint
      Returns the value of the bit with the specified index. The value is true if the bit with the index index is currently set in this fingerprint; otherwise, the result is false.
      Specified by:
      get in interface IBitFingerprint
      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: IBitFingerprint
      Sets the bit at the specified index to the specified value.
      Specified by:
      set in interface IBitFingerprint
      Parameters:
      index - the index of the bit to change
      value - the new value for the bit at position index
    • asBitSet

      public BitSet asBitSet()
      Description copied from interface: IBitFingerprint
      Returns a BitSet representation of the fingerprint. This might take significantly more memory!
      Specified by:
      asBitSet in interface IBitFingerprint
      Returns:
      the fingerprint as a BitSet
    • set

      public void set(int i)
      Description copied from interface: IBitFingerprint
      Sets the bit at the specified index to true.
      Specified by:
      set in interface IBitFingerprint
      Parameters:
      i - index
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getSetbits

      public int[] getSetbits()
      Description copied from interface: IBitFingerprint
      Returns a listing of the bits in the fingerprint that are set to true.
      Specified by:
      getSetbits in interface IBitFingerprint
      Returns:
      listing of all bits that are set