Package com.aptana.shared_core.string

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


    }

    public void testAppendN() throws Exception {
        FastStringBuffer buf = new FastStringBuffer(0);
        assertEquals("   ", buf.appendN(' ', 3).toString());
        assertEquals("   ", buf.clear().appendN(" ", 3).toString());
        assertEquals("   aaa", buf.appendN('a', 3).toString());
        assertEquals("   aaabbbbbb", buf.appendN("bb", 3).toString());
    }

    public void testStartsWith() throws Exception {
View Full Code Here


        assertEquals(0, buf.length());

        buf.append("aa  bb b  \nbb");
        buf.removeWhitespaces();
        assertEquals("aabbbbb", buf.toString());
        buf.clear();

        buf.append("  a\ra  bb b  \nbb  ");
        buf.removeWhitespaces();
        assertEquals("aabbbbb", buf.toString());
    }
View Full Code Here

                if (i < len - 1 && string.charAt(i + 1) == '\n') {
                    i++;
                    buf.append('\n');
                }
                ret.add(buf.toString());
                buf.clear();
            }
            if (c == '\n') {
                ret.add(buf.toString());
                buf.clear();
View Full Code Here

                ret.add(buf.toString());
                buf.clear();
            }
            if (c == '\n') {
                ret.add(buf.toString());
                buf.clear();

            }
        }
        if (buf.length() != 0) {
            ret.add(buf.toString());
View Full Code Here

            current.addAll(getFilesStartingWith(parentDir, prefix));

            FastStringBuffer buf = new FastStringBuffer();

            for (long i = 0; i < Long.MAX_VALUE; i++) {
                String v = buf.clear().append(prefix).append(i).append(extension).toString();
                if (current.contains(v)) {
                    continue;
                }
                File file = new File(parentDir, v);
                if (!file.exists()) {
View Full Code Here

        List<Tuple<TextEdit, String>> ret = new ArrayList<Tuple<TextEdit, String>>();
        //occurrences = sortOccurrences(occurrences);

        FastStringBuffer entryBuf = new FastStringBuffer();
        for (ASTEntry entry : occurrences) {
            entryBuf.clear();

            Integer loc = (Integer) entry.getAdditionalInfo(AstEntryScopeAnalysisConstants.AST_ENTRY_FOUND_LOCATION, 0);

            if (loc == AstEntryScopeAnalysisConstants.AST_ENTRY_FOUND_IN_COMMENT) {
                entryBuf.append("Change (comment): ");
View Full Code Here

        assertEquals(1, in.getEndColumn());
        assertEquals(1, in.getEndLine());
        assertEquals("a", in.GetImage());

        assertEquals("a", new String(in.GetSuffix(1)));
        in.AppendSuffix(buf.clear(), 1);
        assertEquals("a", buf.toString());

        char[] cs = new char[2];
        cs[1] = 'a';
        assertEquals(new String(cs), new String(in.GetSuffix(2)));
View Full Code Here

        assertEquals("a", buf.toString());

        char[] cs = new char[2];
        cs[1] = 'a';
        assertEquals(new String(cs), new String(in.GetSuffix(2)));
        in.AppendSuffix(buf.clear(), 2);
        assertEquals(new String(cs), buf.toString());

        cs = new char[3];
        cs[2] = 'a';
        assertEquals(new String(cs), new String(in.GetSuffix(3)));
View Full Code Here

        assertEquals(new String(cs), buf.toString());

        cs = new char[3];
        cs[2] = 'a';
        assertEquals(new String(cs), new String(in.GetSuffix(3)));
        in.AppendSuffix(buf.clear(), 3);
        assertEquals(new String(cs), buf.toString());

        assertEquals('\n', in.readChar());
        checkStart(in, 1, 1);
        assertEquals(2, in.getEndColumn());
View Full Code Here

        checkStart(in, 1, 1);
        assertEquals(2, in.getEndColumn());
        assertEquals(1, in.getEndLine());
        assertEquals("a\n", in.GetImage());
        assertEquals("\n", new String(in.GetSuffix(1)));
        in.AppendSuffix(buf.clear(), 1);
        assertEquals("\n", buf.toString());

        assertEquals("a\n", new String(in.GetSuffix(2)));
        in.AppendSuffix(buf.clear(), 2);
        assertEquals("a\n", buf.toString());
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.