Holger's Java API

## com.antelmann.cddb
Class FuzzyLookup

    java.lang.Object
      com.antelmann.cddb.FuzzyLookup

All Implemented Interfaces:
  Serializable

    public class FuzzyLookup

extends Object
implements Serializable

FuzzyLookup provides a mapping between CDID and CDDBRecord objects, to support inexact matches for FileCDDB queries. The mapping is based on previous lookups on FreeDB. The mapping is done simply by providing a list of other 'similar' discIDs given a specific discID. These discIDs can then be used to match CDID and CDDBRecords.

Author:
  Holger Antelmann
See Also:
  `CDID`, `CDDBRecord`, `FileCDDB`, Serialized Form

Constructor Summary
`FuzzyLookup()`

Method Summary
`String[]` `addMatch(String discID, String[] similarDiscIDs)` adds the given mapping to the table
`void` `exportToFile(File file)` exports all map entries into a file.
`String[]` `findMatch(CDID cd)` retrieves a list of discIDs similar to the one given - if available
`String[]` `findMatch(String discID)`
`void` `importFromFile(File file)` imports the map from a file; each entry is put into the current map

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FuzzyLookup

    public FuzzyLookup()

Method Detail

### findMatch

    public String[] findMatch(CDID cd)

  retrieves a list of discIDs similar to the one given - if available

### findMatch

    public String[] findMatch(String discID)

### addMatch

    public String[] addMatch(String discID,
                             String[] similarDiscIDs)

  adds the given mapping to the table

### importFromFile

    public void importFromFile(File file)
                        throws IOException

  imports the map from a file; each entry is put into the current map

  Throws:
    `IOException`
  See Also:
    `exportToFile(File)`

### exportToFile

    public void exportToFile(File file)
                      throws IOException

  exports all map entries into a file. The map entries are represented as separate lines ('\n' terminated), while each line contains the keyDiscID + " " + simID1 + " " + simID2 ....
  An existing file at the specified location will be overwritten if the file attributes permit this.

  Throws:
    `IOException`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads