Class IntArrayCountFingerprint

    • Constructor Detail

      • IntArrayCountFingerprint

        public IntArrayCountFingerprint()
      • IntArrayCountFingerprint

        public IntArrayCountFingerprint​(Map<String,​Integer> rawFingerprint)
      • IntArrayCountFingerprint

        public IntArrayCountFingerprint​(Map<String,​Integer> rawFingerprint,
                                        boolean behaveAsBitFingerprint)
        Create an IntArrayCountFingerprint from a rawFingerprint and if behaveAsBitFingerprint make it only return 0 or 1 as count thus behaving like a bit finger print.
        Parameters:
        rawFingerprint - the raw fp
        behaveAsBitFingerprint - whether to behave as binary fp or not
    • Method Detail

      • size

        public long size()
        Description copied from interface: ICountFingerprint
        Returns the number of bits of this fingerprint.
        Specified by:
        size in interface ICountFingerprint
        Returns:
        the size of the fingerprint.
      • getCount

        public int getCount​(int index)
        Description copied from interface: ICountFingerprint
        Returns the count value for the bin with the given index.
        Specified by:
        getCount in interface ICountFingerprint
        Parameters:
        index - the index of the bin to return the number of hits for.
        Returns:
        the count for the bin with given index.
      • getHash

        public int getHash​(int index)
        Description copied from interface: ICountFingerprint
        Returns the hash corresponding to the given index in the fingerprint.
        Specified by:
        getHash in interface ICountFingerprint
        Parameters:
        index - the index of the bin to return the hash for.
        Returns:
        the hash for the bin with the given index.
      • setBehaveAsBitFingerprint

        public void setBehaveAsBitFingerprint​(boolean behaveAsBitFingerprint)
        Description copied from interface: ICountFingerprint
        Changes behaviour, if true is given the count fingerprint will behave as a bit fingerprint and return 0 or 1 for counts.
        Specified by:
        setBehaveAsBitFingerprint in interface ICountFingerprint
      • hasHash

        public boolean hasHash​(int hash)
        Description copied from interface: ICountFingerprint
        Whether the fingerprint contains the given hash.
        Specified by:
        hasHash in interface ICountFingerprint
        Returns:
        true if the fingerprint contains the given hash, otherwise false.
      • getCountForHash

        public int getCountForHash​(int hash)
        Description copied from interface: ICountFingerprint
        Get the number of times a certain hash exists in the fingerprint.
        Specified by:
        getCountForHash in interface ICountFingerprint
        Returns:
        the number associated with the given hash