cc.redberry.core.context.defaults
Class IndexWithStrokeConverter
- java.lang.Object
-
- cc.redberry.core.context.defaults.IndexWithStrokeConverter
-
- All Implemented Interfaces:
- IndexSymbolConverter
public final class IndexWithStrokeConverter extends java.lang.Object implements IndexSymbolConverter
IndexSymbolConverterfor letters with strokes (e.g. \\alpha' or A'').- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor and Description IndexWithStrokeConverter(IndexSymbolConverter converter, byte numberOfStrokes)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.
-
-
-
Constructor Detail
-
IndexWithStrokeConverter
public IndexWithStrokeConverter(IndexSymbolConverter converter, byte numberOfStrokes)
CreatesIndexSymbolConverterfor subscripted symbols from specified converter.- Parameters:
converter- converter to be extended with symbols with strokesnumberOfStrokes- number of strokes to be appended after symbol
-
-
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
-
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
-
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
-
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
-
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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG