Package com.aptana.shared_core.string

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


            String expected = "-- VERSION_" + AbstractAdditionalTokensInfo.version; //X is the version
            InputStreamReader reader = new InputStreamReader(fileInputStream);
            FastBufferedReader bufferedReader = new FastBufferedReader(reader);
            FastStringBuffer string = bufferedReader.readLine();
            ObjectsPoolMap objectsPoolMap = new ObjectsPool.ObjectsPoolMap();
            if (string != null && string.startsWith("-- VERSION_")) {
                Tuple tupWithResults = new Tuple(new Tuple3(null, null, null), null);
                Tuple3 superTupWithResults = (Tuple3) tupWithResults.o1;
                //tupWithResults.o2 = DiskCache
                if (string.toString().equals(expected)) {
                    //OK, proceed with new I/O format!
View Full Code Here


            //each line is something as: cub|CubeColourDialog!13&999@CUBIC!263@cube!202&999@
            //note: the path (2nd int in record) is optional
            for (int iEntry = 0; iEntry < size; iEntry++) {
                buf.clear();
                FastStringBuffer line = reader.readLine();
                if (line == null || line.startsWith("-- ")) {
                    throw new RuntimeException("Unexpected line: " + line);
                }
                char[] internalCharsArray = line.getInternalCharsArray();
                int length = line.length();
                String key = null;
View Full Code Here

        while (true) {
            line = reader.readLine();
            if (line == null) {
                return map;

            } else if (line.startsWith("-- ")) {
                if (line.startsWith("-- END DICTIONARY")) {
                    return map;
                }
                throw new RuntimeException("Unexpected line: " + line);
View Full Code Here

            line = reader.readLine();
            if (line == null) {
                return map;

            } else if (line.startsWith("-- ")) {
                if (line.startsWith("-- END DICTIONARY")) {
                    return map;
                }
                throw new RuntimeException("Unexpected line: " + line);

            } else {
View Full Code Here

     */
    public static DiskCache loadFrom(FastBufferedReader reader, ObjectsPoolMap objectsPoolMap) throws IOException {
        DiskCache diskCache = new DiskCache();

        FastStringBuffer line = reader.readLine();
        if (line.startsWith("-- ")) {
            throw new RuntimeException("Unexpected line: " + line);
        }
        diskCache.folderToPersist = line.toString();

        line = reader.readLine();
View Full Code Here

            throw new RuntimeException("Unexpected line: " + line);
        }
        diskCache.folderToPersist = line.toString();

        line = reader.readLine();
        if (line.startsWith("-- ")) {
            throw new RuntimeException("Unexpected line: " + line);
        }
        diskCache.suffix = line.toString();

        Map<CompleteIndexKey, CompleteIndexKey> diskKeys = diskCache.keys;
View Full Code Here

        assertTrue(fastStringBuffer.endsWith("c"));
        assertTrue(fastStringBuffer.endsWith("bc"));
        assertTrue(fastStringBuffer.endsWith("abc"));
        assertTrue(!fastStringBuffer.endsWith("aabc"));

        assertTrue(fastStringBuffer.startsWith("abc"));
        assertTrue(fastStringBuffer.startsWith("a"));
        assertTrue(fastStringBuffer.startsWith("ab"));
        assertTrue(!fastStringBuffer.startsWith("abcd"));

        fastStringBuffer.setCharAt(0, 'h');
View Full Code Here

        assertTrue(fastStringBuffer.endsWith("bc"));
        assertTrue(fastStringBuffer.endsWith("abc"));
        assertTrue(!fastStringBuffer.endsWith("aabc"));

        assertTrue(fastStringBuffer.startsWith("abc"));
        assertTrue(fastStringBuffer.startsWith("a"));
        assertTrue(fastStringBuffer.startsWith("ab"));
        assertTrue(!fastStringBuffer.startsWith("abcd"));

        fastStringBuffer.setCharAt(0, 'h');
        assertTrue(fastStringBuffer.startsWith("hb"));
View Full Code Here

        assertTrue(fastStringBuffer.endsWith("abc"));
        assertTrue(!fastStringBuffer.endsWith("aabc"));

        assertTrue(fastStringBuffer.startsWith("abc"));
        assertTrue(fastStringBuffer.startsWith("a"));
        assertTrue(fastStringBuffer.startsWith("ab"));
        assertTrue(!fastStringBuffer.startsWith("abcd"));

        fastStringBuffer.setCharAt(0, 'h');
        assertTrue(fastStringBuffer.startsWith("hb"));
    }
View Full Code Here

        assertTrue(!fastStringBuffer.endsWith("aabc"));

        assertTrue(fastStringBuffer.startsWith("abc"));
        assertTrue(fastStringBuffer.startsWith("a"));
        assertTrue(fastStringBuffer.startsWith("ab"));
        assertTrue(!fastStringBuffer.startsWith("abcd"));

        fastStringBuffer.setCharAt(0, 'h');
        assertTrue(fastStringBuffer.startsWith("hb"));
    }
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.