Package com.aptana.shared_core.string

Examples of com.aptana.shared_core.string.FastStringBuffer.lastChar()


    public boolean endsWithSpace() {
        FastStringBuffer current = buf.peek();
        if (current.length() == 0) {
            return false;
        }
        return current.lastChar() == ' ';
    }

    public FastStringBuffer getBuffer() {
        return buf.peek();
    }
View Full Code Here


        } catch (SyntaxErrorException e) {
        }
        FastStringBuffer buf = new FastStringBuffer();
        for (String line : StringUtils.splitInLines(str)) {
            buf.append(line);
            char c = buf.lastChar();
            if (c == '\n') {
                buf.deleteLast();
                if (showSpacesAndNewLines) {
                    buf.append("\\n");
                }
View Full Code Here

                case '\r':
                    //Fallthrough

                case '\n':
                    //Note that we don't add the \r nor \n to the memo (but we clear it if the  line did not end with a \).
                    if (lineMemo.length() > 0 && lineMemo.lastChar() != '\\') {
                        lineMemo.clear();
                    }
                    break;

                default:
View Full Code Here

                        if ((i = line.indexOf('#')) != -1) {
                            buffer = new FastStringBuffer(line.substring(0, i), 0);
                        } else {
                            buffer = new FastStringBuffer(line, 0);
                        }
                        while (buffer.length() > 0 && Character.isWhitespace(buffer.lastChar())) {
                            buffer.deleteLast();
                        }
                        absoluteEnd = start.getOffset() + buffer.length();
                    }
                } catch (BadLocationException e) {
View Full Code Here

            }
        }

        //last line
        if (buf.length() > 0) {
            char c = buf.lastChar();
            if (c == '\r' || c == '\n') {
                buf.append(indentationToAdd);
            }
        }
View Full Code Here

        int lastState = 0;
        for (int i = 0; i < len; i++) {
            char c = string.charAt(i);
            if (Character.isUpperCase(c)) {
                if (lastState != STATE_UPPER) {
                    if (buf.length() > 0 && buf.lastChar() != '_') {
                        buf.append('_');
                    }
                }
                buf.append(Character.toLowerCase(c));
                lastState = STATE_UPPER;
View Full Code Here

                buf.append(Character.toLowerCase(c));
                lastState = STATE_UPPER;

            } else if (Character.isDigit(c)) {
                if (lastState != STATE_NUMBER) {
                    if (buf.length() > 0 && buf.lastChar() != '_') {
                        buf.append('_');
                    }
                }

                buf.append(c);
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.