Package org.apache.lucene.analysis.ja.dict

## Class ConnectionCosts

- java.lang.Object
- - org.apache.lucene.analysis.ja.dict.ConnectionCosts

-     public final class ConnectionCosts
      extends Object

  n-gram connection cost data

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `FILENAME_SUFFIX` |
    `static String` | `HEADER` |
    `static int` | `VERSION` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ConnectionCosts​(URL connectionCostsUrl)` | Create a `ConnectionCosts` from an external resource URL (e.g.
    `ConnectionCosts​(Path connectionCostsFile)` | Create a `ConnectionCosts` from an external resource path.
    `ConnectionCosts​(BinaryDictionary.ResourceScheme scheme, String path)` | Deprecated, for removal: This API element is subject to removal in a future version. replaced by `ConnectionCosts(Path)` for files and `ConnectionCosts(URL)` for classpath/module resources.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `get​(int forwardId, int backwardId)` |
    `static ConnectionCosts` | `getInstance()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### FILENAME_SUFFIX

          public static final String FILENAME_SUFFIX

      See Also:
        Constant Field Values

    - #### HEADER

          public static final String HEADER

      See Also:
        Constant Field Values

    - #### VERSION

          public static final int VERSION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ConnectionCosts

          @Deprecated(forRemoval=true,
                      since="9.1")
          public ConnectionCosts​(BinaryDictionary.ResourceScheme scheme,
                                 String path)
                          throws IOException

      Deprecated, for removal: This API element is subject to removal in a future version.
      replaced by `ConnectionCosts(Path)` for files and `ConnectionCosts(URL)` for classpath/module resources.
      Parameters:
        `scheme` - - scheme for loading resources (FILE or CLASSPATH).
        `path` - - where to load resources from, without the ".dat" suffix
      Throws:
        `IOException`

    - #### ConnectionCosts

          public ConnectionCosts​(Path connectionCostsFile)
                          throws IOException

      Create a `ConnectionCosts` from an external resource path.
      Parameters:
        `connectionCostsFile` - where to load connection costs resource
      Throws:
        `IOException` - if resource was not found or broken

    - #### ConnectionCosts

          public ConnectionCosts​(URL connectionCostsUrl)
                          throws IOException

      Create a `ConnectionCosts` from an external resource URL (e.g. from Classpath with `ClassLoader.getResource(String)`).
      Parameters:
        `connectionCostsUrl` - where to load connection costs resource
      Throws:
        `IOException` - if resource was not found or broken

  - ### Method Detail

    - #### get

          public int get​(int forwardId,
                         int backwardId)

    - #### getInstance

          public static ConnectionCosts getInstance()