Examples of prevCharHead()


Examples of org.jcodings.Encoding.prevCharHead()

        byte[]bytes = valueCopy.getUnsafeBytes();

        NeighborChar neighbor = NeighborChar.FOUND;
        int lastAlnum = -1;
        boolean alnumSeen = false;
        while ((s = enc.prevCharHead(bytes, p, s, end)) != -1) {
            if (neighbor == NeighborChar.NOT_CHAR && lastAlnum != -1) {
                if (ASCII.isAlpha(bytes[lastAlnum] & 0xff) ?
                        ASCII.isDigit(bytes[s] & 0xff) :
                        ASCII.isDigit(bytes[lastAlnum] & 0xff) ?
                                ASCII.isAlpha(bytes[s] & 0xff) : false) {
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

            carryLen = cl;
        }

        if (!alnumSeen) {
            s = end;
            while ((s = enc.prevCharHead(bytes, p, s, end)) != -1) {
                int cl = StringSupport.preciseLength(enc, bytes, s, end);
                if (cl <= 0) continue;
                neighbor = succChar(enc, bytes, s, cl);
                if (neighbor == NeighborChar.FOUND) return valueCopy;
                if (StringSupport.preciseLength(enc, bytes, s, s + 1) != cl) succChar(enc, bytes, s, cl); /* wrapped to \0...\0.  search next valid char. */
 
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

        if (p > end) return 0;
        byte bytes[] = value.getUnsafeBytes();
        Encoding enc = value.getEncoding();

        int s = enc.prevCharHead(bytes, p, end, end);
        if (s == -1) return 0;
        if (s > p && codePoint(runtime, enc, bytes, s, end) == '\n') {
            int s2 = enc.prevCharHead(bytes, p, s, end);
            if (s2 != -1 && codePoint(runtime, enc, bytes, s2, end) == '\r') s = s2;
        }
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

        Encoding enc = value.getEncoding();

        int s = enc.prevCharHead(bytes, p, end, end);
        if (s == -1) return 0;
        if (s > p && codePoint(runtime, enc, bytes, s, end) == '\n') {
            int s2 = enc.prevCharHead(bytes, p, s, end);
            if (s2 != -1 && codePoint(runtime, enc, bytes, s2, end) == '\r') s = s2;
        }
        return s - p;
    }
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

        int start = value.getBegin();
        int end = start + value.getRealSize();
        Encoding enc = value.getEncoding();
        int endp = end;
        int prev;
        while ((prev = enc.prevCharHead(bytes, start, endp, end)) != -1) {
            int point = codePoint(runtime, enc, bytes, prev, end);
            if (point != 0 && !enc.isSpace(point)) break;
            endp = prev;
        }
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

        int c;
        while (p < end && enc.isSpace(c = codePoint(runtime, enc, bytes, p, end))) p += codeLength(runtime, enc, c);
       
        int endp = end;
        int prev;
        while ((prev = enc.prevCharHead(bytes, s, endp, end)) != -1) {
            int code = codePoint(runtime, enc, bytes, prev, end);
            if (code != 0 && !enc.isSpace(code)) break;
            endp = prev;
        }
        if (p > s || prev < end) {
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

        byte[]bytes = valueCopy.getUnsafeBytes();

        NeighborChar neighbor = NeighborChar.FOUND;
        int lastAlnum = -1;
        boolean alnumSeen = false;
        while ((s = enc.prevCharHead(bytes, p, s, end)) != -1) {
            if (neighbor == NeighborChar.NOT_CHAR && lastAlnum != -1) {
                if (ASCII.isAlpha(bytes[lastAlnum] & 0xff) ?
                        ASCII.isDigit(bytes[s] & 0xff) :
                        ASCII.isDigit(bytes[lastAlnum] & 0xff) ?
                                ASCII.isAlpha(bytes[s] & 0xff) : false) {
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

            carryLen = cl;
        }

        if (!alnumSeen) {
            s = end;
            while ((s = enc.prevCharHead(bytes, p, s, end)) != -1) {
                int cl = StringSupport.preciseLength(enc, bytes, s, end);
                if (cl <= 0) continue;
                neighbor = succChar(enc, bytes, s, cl);
                if (neighbor == NeighborChar.FOUND) return valueCopy;
                if (StringSupport.preciseLength(enc, bytes, s, s + 1) != cl) succChar(enc, bytes, s, cl); /* wrapped to \0...\0.  search next valid char. */
 
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

        if (p > end) return 0;
        byte bytes[] = value.getUnsafeBytes();
        Encoding enc = value.getEncoding();

        int s = enc.prevCharHead(bytes, p, end, end);
        if (s == -1) return 0;
        if (s > p && codePoint(runtime, enc, bytes, s, end) == '\n') {
            int s2 = enc.prevCharHead(bytes, p, s, end);
            if (s2 != -1 && codePoint(runtime, enc, bytes, s2, end) == '\r') s = s2;
        }
View Full Code Here

Examples of org.jcodings.Encoding.prevCharHead()

        Encoding enc = value.getEncoding();

        int s = enc.prevCharHead(bytes, p, end, end);
        if (s == -1) return 0;
        if (s > p && codePoint(runtime, enc, bytes, s, end) == '\n') {
            int s2 = enc.prevCharHead(bytes, p, s, end);
            if (s2 != -1 && codePoint(runtime, enc, bytes, s2, end) == '\r') s = s2;
        }
        return s - p;
    }
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.