Package cc.redberry.core.context

Examples of cc.redberry.core.context.IndexConverterException


    @Override
    public String getSymbol(int code, OutputFormat mode) throws IndexConverterException {
        int number = code + 0x61;
        if (number > 0x7A)
            throw new IndexConverterException();
        return Character.toString((char) number);
    }
View Full Code Here


    @Override
    public int getCode(String symbol) throws IndexConverterException {
        int codePosition = Arrays.binarySearch(sortedSymbols, symbol);
        if (codePosition < 0)
            throw new IndexConverterException();
        return coSortedCodes[codePosition];
    }
View Full Code Here

    public int getCode(String symbol) throws IndexConverterException {
        if (!symbol.contains("_"))
            return innerConverter.getCode(symbol);
        String[] split = symbol.split("_");
        if (split.length != 2 || split[1].length() == 0)
            throw new IndexConverterException();
        if (split[1].charAt(0) == '{') {
            if (split[1].length() < 3)
                throw new IndexConverterException();
            split[1] = split[1].substring(1, split[1].length() - 1);
        }
        int num;
        try {
            num = Integer.parseInt(split[1]);
        } catch (NumberFormatException e) {
            throw new IndexConverterException();
        }
        return (num) * (1 + innerConverter.maxNumberOfSymbols()) + innerConverter.getCode(split[0]);
    }
View Full Code Here

        try {
            if (mode == OutputFormat.UTF8)
                return utf[code];
            symbol = symbols[code];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new IndexConverterException();
        }
        if (mode == OutputFormat.WolframMathematica)
            symbol = "\\[Capital" + Character.toUpperCase(symbol.charAt(1)) + symbol.substring(2) + "]";
        if (mode == OutputFormat.Maple)
            symbol = symbol.substring(1);
View Full Code Here

        try {
            if (mode == OutputFormat.UTF8)
                return utf[code];
            symbol = symbols[code];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new IndexConverterException();
        }
        if (mode == OutputFormat.WolframMathematica)
            symbol = "\\[" + Character.toUpperCase(symbol.charAt(1)) + symbol.substring(2) + "]";
        if (mode == OutputFormat.Maple)
            symbol = symbol.substring(1);
View Full Code Here

    @Override
    public String getSymbol(int code, OutputFormat mode) throws IndexConverterException {
        int number = code + 0x41;
        if (number > 0x5A)
            throw new IndexConverterException();
        return Character.toString((char) number);
    }
View Full Code Here

        try {
            if (mode.is(OutputFormat.UTF8))
                return utf[code];
            symbol = symbols[code];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new IndexConverterException();
        }
        if (mode.is(OutputFormat.WolframMathematica))
            symbol = "\\[" + Character.toUpperCase(symbol.charAt(1)) + symbol.substring(2) + "]";
        if (mode.is(OutputFormat.Maple))
            symbol = symbol.substring(1);
View Full Code Here

    @Override
    public String getSymbol(int code, OutputFormat mode) throws IndexConverterException {
        int number = code + 0x41;
        if (number > 0x5A)
            throw new IndexConverterException();
        return Character.toString((char) number);
    }
View Full Code Here

    @Override
    public String getSymbol(int code, OutputFormat mode) throws IndexConverterException {
        int number = code + 0x61;
        if (number > 0x7A)
            throw new IndexConverterException();
        return Character.toString((char) number);
    }
View Full Code Here

    @Override
    public int getCode(String symbol) throws IndexConverterException {
        int codePosition = Arrays.binarySearch(sortedSymbols, symbol);
        if (codePosition < 0)
            throw new IndexConverterException();
        return coSortedCodes[codePosition];
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.context.IndexConverterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.