Class Fingerprint

    • Constructor Detail

      • Fingerprint

        public Fingerprint​(List<Subprint> subprints)
      • Fingerprint

        public Fingerprint​(String resourceId)
                    throws IOException

        Resource id based fingerprint.

        All underscores '_'are first replaced with slashes '/', then the resource id is base64 decoded. If the slashes were not 'underscore-escaped' this method still returns a valid fingerprint.

        Parameters:
        resourceId - a byte array based fingerprint that was first base 64 encoded and then had all slashes replaced with underscores
        Throws:
        IOException
        See Also:
        Base64
      • Fingerprint

        public Fingerprint​(byte[] bytes)
                    throws IOException

        Resource id based fingerprint.

        All underscores '_'are first replaced with slashes '/', then the resource id is base64 decoded. If the slashes were not 'underscore-escaped' this method still returns a valid fingerprint.

        Parameters:
        bytes - compressed fingerprint
        Throws:
        IOException
    • Method Detail

      • fromResourceId

        public static byte[] fromResourceId​(String resourceId)
        Transforms a resource id into fingerprint (byte array) by first replacing all '_' with '/' and then decoding it using basic Base64 encoding.
        Parameters:
        resourceId - resource id.
        Returns:
        fingerprint in byte array representation
      • toResourceId

        public static String toResourceId​(byte[] fingerprint)
        Transforms a byte array fingerprint into a resources id by first converting it to basic Base64 and then replacing all '/' with '_'.
        Parameters:
        fingerprint - fingerprint.
        Returns:
        resource id, which can be used for server requests
      • isSparse

        public boolean isSparse()
      • subsample

        public void subsample()
      • hasCurrentVersion

        public boolean hasCurrentVersion()
        Indicates whether this fingerprint is at least of the "current" version.
        Returns:
        true or false
      • getVersion

        public int getVersion()
        TuneCortex fingerprint version.
        Returns:
        version
      • getSong

        public Song getSong()
      • setSong

        public void setSong​(Song song)
      • getSubprint

        public Subprint getSubprint​(short sequenceNumber)
      • getMaxSequenceNumber

        public short getMaxSequenceNumber()
      • bitErrorRate

        public float bitErrorRate​(Fingerprint that,
                                  int thisAnchor,
                                  int thatAnchor)