cc.redberry.core.context
Class IndexConverterManager
- java.lang.Object
-
- cc.redberry.core.context.IndexConverterManager
-
public final class IndexConverterManager extends java.lang.ObjectThis class is responsible for the mapping between strings and internal integer Redberry ids of single tensor index.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field and Description static IndexConverterManagerDEFAULTThe default index converter manager defined for all types of indices defined in enumIndexType.
-
Constructor Summary
Constructors Constructor and Description IndexConverterManager(IndexSymbolConverter[] converters)Creates index converted manager for specified index converters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetCode(java.lang.String index)Returns integer representation from specified string representation of single index.java.lang.StringgetSymbol(int code, OutputFormat outputFormat)Returns string representation from specified integer representation of single index in the specifiedoutputFormat.
-
-
-
Field Detail
-
DEFAULT
public static final IndexConverterManager DEFAULT
The default index converter manager defined for all types of indices defined in enumIndexType.
-
-
Constructor Detail
-
IndexConverterManager
public IndexConverterManager(IndexSymbolConverter[] converters)
Creates index converted manager for specified index converters.- Parameters:
converters- index converters- Throws:
java.lang.IllegalArgumentException- if several converters have the same index type
-
-
Method Detail
-
getSymbol
public java.lang.String getSymbol(int code, OutputFormat outputFormat)Returns string representation from specified integer representation of single index in the specifiedoutputFormat.- Parameters:
code- integer representation of single indexoutputFormat- output format to be used to produce string representation- Returns:
- string representation of specified integer index
- Throws:
java.lang.IllegalArgumentException- if rule for specified code
-
getCode
public int getCode(java.lang.String index)
Returns integer representation from specified string representation of single index.- Parameters:
index- string representation of single index- Returns:
- integer representation of specified index
- Throws:
java.lang.IllegalArgumentException- if rule for specified string
-
-
DataMelt 3.0 © DataMelt by jWork.ORG