Class ConnectionCosts
- java.lang.Object
-
- org.apache.lucene.analysis.ja.dict.ConnectionCosts
-
public final class ConnectionCosts extends java.lang.Objectn-gram connection cost data
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classConnectionCosts.SingletonHolder
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBufferbufferstatic java.lang.StringFILENAME_SUFFIXprivate intforwardSizestatic java.lang.StringHEADERstatic intVERSION
-
Constructor Summary
Constructors Modifier Constructor Description privateConnectionCosts()ConnectionCosts(java.net.URL connectionCostsUrl)Create aConnectionCostsfrom an external resource URL (e.g.ConnectionCosts(java.nio.file.Path connectionCostsFile)Create aConnectionCostsfrom an external resource path.ConnectionCosts(BinaryDictionary.ResourceScheme scheme, java.lang.String path)Deprecated, for removal: This API element is subject to removal in a future version.replaced byConnectionCosts(Path)for files andConnectionCosts(URL)for classpath/module resources.privateConnectionCosts(IOSupplier<java.io.InputStream> connectionCostResource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intget(int forwardId, int backwardId)private static java.io.InputStreamgetClassResource()static ConnectionCostsgetInstance()
-
-
-
Field Detail
-
FILENAME_SUFFIX
public static final java.lang.String FILENAME_SUFFIX
- See Also:
- Constant Field Values
-
HEADER
public static final java.lang.String HEADER
- See Also:
- Constant Field Values
-
VERSION
public static final int VERSION
- See Also:
- Constant Field Values
-
buffer
private final java.nio.ByteBuffer buffer
-
forwardSize
private final int forwardSize
-
-
Constructor Detail
-
ConnectionCosts
@Deprecated(forRemoval=true, since="9.1") public ConnectionCosts(BinaryDictionary.ResourceScheme scheme, java.lang.String path) throws java.io.IOExceptionDeprecated, for removal: This API element is subject to removal in a future version.replaced byConnectionCosts(Path)for files andConnectionCosts(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:
java.io.IOException
-
ConnectionCosts
public ConnectionCosts(java.nio.file.Path connectionCostsFile) throws java.io.IOExceptionCreate aConnectionCostsfrom an external resource path.- Parameters:
connectionCostsFile- where to load connection costs resource- Throws:
java.io.IOException- if resource was not found or broken
-
ConnectionCosts
public ConnectionCosts(java.net.URL connectionCostsUrl) throws java.io.IOExceptionCreate aConnectionCostsfrom an external resource URL (e.g. from Classpath withClassLoader.getResource(String)).- Parameters:
connectionCostsUrl- where to load connection costs resource- Throws:
java.io.IOException- if resource was not found or broken
-
ConnectionCosts
private ConnectionCosts() throws java.io.IOException- Throws:
java.io.IOException
-
ConnectionCosts
private ConnectionCosts(IOSupplier<java.io.InputStream> connectionCostResource) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getClassResource
private static java.io.InputStream getClassResource() throws java.io.IOException- Throws:
java.io.IOException
-
get
public int get(int forwardId, int backwardId)
-
getInstance
public static ConnectionCosts getInstance()
-
-