cc.redberry.core.context.defaults
Class IndexConverterExtender
- java.lang.Object
-
- cc.redberry.core.context.defaults.IndexConverterExtender
-
- All Implemented Interfaces:
- IndexSymbolConverter
public final class IndexConverterExtender extends java.lang.Object implements IndexSymbolConverter
IndexSymbolConverterfor subscripted letters (e.g. \\alpha_{2} or A_{4}).- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field and Description static IndexConverterExtenderGreekLowerExIndexSymbolConverterfor subscripted Greek lower case letters.static IndexConverterExtenderGreekUpperExIndexSymbolConverterfor subscripted Greek upper case letters.static IndexConverterExtenderLatinLowerExIndexSymbolConverterfor subscripted latin lower case letters.static IndexConverterExtenderLatinUpperExIndexSymbolConverterfor subscripted latin upper case letters.
-
Constructor Summary
Constructors Constructor and Description IndexConverterExtender(IndexSymbolConverter innerConverter)CreatesIndexSymbolConverterfor subscripted symbols from specified converter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanapplicableToSymbol(java.lang.String symbol)Returns true if this converter can convert index string to integer representationintgetCode(java.lang.String symbol)Returns integer representation from specified string representation of single index.java.lang.StringgetSymbol(int code, OutputFormat mode)Returns string representation from specified integer representation of single index in the specifiedoutputFormat.bytegetType()Returns the type of indices, which this converter processes.intmaxNumberOfSymbols()Returns the number of symbols, supported by this converter.
-
-
-
Field Detail
-
LatinLowerEx
public static final IndexConverterExtender LatinLowerEx
IndexSymbolConverterfor subscripted latin lower case letters.
-
LatinUpperEx
public static final IndexConverterExtender LatinUpperEx
IndexSymbolConverterfor subscripted latin upper case letters.
-
GreekLowerEx
public static final IndexConverterExtender GreekLowerEx
IndexSymbolConverterfor subscripted Greek lower case letters.
-
GreekUpperEx
public static final IndexConverterExtender GreekUpperEx
IndexSymbolConverterfor subscripted Greek upper case letters.
-
-
Constructor Detail
-
IndexConverterExtender
public IndexConverterExtender(IndexSymbolConverter innerConverter)
CreatesIndexSymbolConverterfor subscripted symbols from specified converter.- Parameters:
innerConverter- converter to be extended with subscripted symbols
-
-
Method Detail
-
applicableToSymbol
public boolean applicableToSymbol(java.lang.String symbol)
Description copied from interface:IndexSymbolConverterReturns true if this converter can convert index string to integer representation- Specified by:
applicableToSymbolin interfaceIndexSymbolConverter- Parameters:
symbol- index string representation- Returns:
- true, if this converter can convert index string to integer representation
-
getCode
public int getCode(java.lang.String symbol) throws IndexConverterExceptionDescription copied from interface:IndexSymbolConverterReturns integer representation from specified string representation of single index.- Specified by:
getCodein interfaceIndexSymbolConverter- Parameters:
symbol- index string representation- Returns:
- index integer representation
- Throws:
IndexConverterException- if converter does not applicable to specified symbol
-
getSymbol
public java.lang.String getSymbol(int code, OutputFormat mode) throws IndexConverterExceptionDescription copied from interface:IndexSymbolConverterReturns string representation from specified integer representation of single index in the specifiedoutputFormat.- Specified by:
getSymbolin interfaceIndexSymbolConverter- Parameters:
code- index integer representationmode- output format- Returns:
- string representation of specified integer index, according to the specified output format
- Throws:
IndexConverterException- if code does not corresponds to this converter- See Also:
OutputFormat
-
getType
public byte getType()
Description copied from interface:IndexSymbolConverterReturns the type of indices, which this converter processes. The type value is unique for each converter.- Specified by:
getTypein interfaceIndexSymbolConverter- Returns:
- type of indices, which this converter process
-
maxNumberOfSymbols
public int maxNumberOfSymbols()
Description copied from interface:IndexSymbolConverterReturns the number of symbols, supported by this converter. For exampleLatinLowerCaseConvertersupports 26 symbols (Latin alphabet size).- Specified by:
maxNumberOfSymbolsin interfaceIndexSymbolConverter- Returns:
- the number of symbols, supported by this converter
-
-
DataMelt 3.0 © DataMelt by jWork.ORG