Examples of UTF8StringCharacterIterator


Examples of org.apache.vxquery.runtime.functions.strings.UTF8StringCharacterIterator

        convertStringExtra(stringp, dOut, false);
    }

    private void convertStringExtra(UTF8StringPointable stringp, DataOutput dOut, boolean connoicalForm)
            throws SystemException, IOException {
        ICharacterIterator charIterator = new UTF8StringCharacterIterator(stringp);
        charIterator.reset();
        byte decimalPlace = 0;
        long value = 0;
        boolean pastDecimal = false, negativeValue = false;
        int count = 0;
        int c = 0;

        // Check sign.
        c = charIterator.next();
        if (c == Character.valueOf('-')) {
            negativeValue = true;
            c = charIterator.next();
        }

        // Read in the number.
        do {
            if (count + 1 > XSDecimalPointable.PRECISION) {
                throw new SystemException(ErrorCode.FOCA0006);
            } else if (Character.isDigit(c)) {
                value = value * 10 + Character.getNumericValue(c);
                if (pastDecimal) {
                    decimalPlace++;
                }
                count++;
            } else if (c == Character.valueOf('.') && pastDecimal == false) {
                pastDecimal = true;
            } else if (c == Character.valueOf('E') || c == Character.valueOf('e') && connoicalForm) {
                break;
            } else {
                throw new SystemException(ErrorCode.FORG0001);
            }
        } while ((c = charIterator.next()) != ICharacterIterator.EOS_CHAR);

        // Parse the exponent.
        if (c == Character.valueOf('E') || c == Character.valueOf('e') && connoicalForm) {
            int moveOffset = 0;
            boolean negativeOffset = false;
            // Check for the negative sign.
            c = charIterator.next();
            if (c == Character.valueOf('-')) {
                negativeOffset = true;
                c = charIterator.next();
            }
            // Process the numeric value.
            do {
                if (Character.isDigit(c)) {
                    moveOffset = moveOffset * 10 + Character.getNumericValue(c);
                } else {
                    throw new SystemException(ErrorCode.FORG0001);
                }
            } while ((c = charIterator.next()) != ICharacterIterator.EOS_CHAR);
            decimalPlace -= (negativeOffset ? -moveOffset : moveOffset);
        }

        // Normalize the value and take off trailing zeros.
        while (value != 0 && value % 10 == 0) {
View Full Code Here

Examples of org.apache.vxquery.runtime.functions.strings.UTF8StringCharacterIterator

    }

    @Override
    public void convertString(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException {
        byte result = 2;
        ICharacterIterator charIterator = new LowerCaseCharacterIterator(new UTF8StringCharacterIterator(stringp));
        charIterator.reset();

        int c1 = charIterator.next();
        int c2 = charIterator.next();
        int c3 = charIterator.next();
View Full Code Here

Examples of org.apache.vxquery.runtime.functions.strings.UTF8StringCharacterIterator

                    dOut.write(ValueTag.XS_QNAME_TAG);
                    dOut.write(paramURI.getByteArray(), paramURI.getStartOffset(), paramURI.getLength());

                    // Separate the local name and prefix.
                    abvsParamQName.reset();
                    ICharacterIterator charIterator = new UTF8StringCharacterIterator(paramQName);
                    charIterator.reset();
                    int c = 0;
                    int prefixLength = 0;
                    while ((c = charIterator.next()) != ICharacterIterator.EOS_CHAR) {
                        if (c == Character.valueOf(':')) {
                            prefixLength = abvsParamQName.getLength();
                        } else {
                            FunctionHelper.writeChar((char) c, dOutParamQName);
                        }
View Full Code Here

Examples of org.apache.vxquery.runtime.functions.strings.UTF8StringCharacterIterator

        return ((value & 0x8000000000000000L) == 0 ? true : false);
    }

    public static void printUTF8String(UTF8StringPointable stringp) {
        System.err.println(" printUTF8String START length = " + stringp.getUTFLength());
        ICharacterIterator charIterator = new UTF8StringCharacterIterator(stringp);
        charIterator.reset();
        for (int c = charIterator.next(); c != ICharacterIterator.EOS_CHAR; c = charIterator.next()) {
            System.err.println("   parse value '" + c + "' as '" + Character.valueOf((char) c) + "'");
        }
        System.err.println(" printUTF8String END");
    }
View Full Code Here

Examples of org.apache.vxquery.runtime.functions.strings.UTF8StringCharacterIterator

        return ((value & 0x8000000000000000L) == 0 ? true : false);
    }

    public static void printUTF8String(UTF8StringPointable stringp) {
        System.err.println(" printUTF8String START length = " + stringp.getUTFLength());
        ICharacterIterator charIterator = new UTF8StringCharacterIterator(stringp);
        charIterator.reset();
        for (int c = charIterator.next(); c != ICharacterIterator.EOS_CHAR; c = charIterator.next()) {
            System.err.println("   parse value '" + c + "' as '" + Character.valueOf((char) c) + "'");
        }
        System.err.println(" printUTF8String END");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.