Package com.ctc.wstx.util

Examples of com.ctc.wstx.util.WordSet


        set.add("length");
        set.add("leno");
        set.add("1");
        set.add("foobar");

        WordSet ws = WordSet.constructSet(set);

        // Let's first check if words that should be there, are:
        for (String str : set) {
            assertTrue(ws.contains(str));
            // And then, let's make sure intern()ing isn't needed:
            assertTrue(ws.contains(""+str));

            char[] strArr = str.toCharArray();
            char[] strArr2 = new char[strArr.length + 4];
            System.arraycopy(strArr, 0, strArr2, 3, strArr.length);
            assertTrue(ws.contains(strArr, 0, str.length()));
            assertTrue(ws.contains(strArr2, 3, str.length() + 3));
        }

        // And then that ones shouldn't be there aren't:
        checkNotFind(ws, "foo");
View Full Code Here


        set.add("length");
        set.add("leno");
        set.add("1");
        set.add("foobar");

        WordSet ws = WordSet.constructSet(set);
        Iterator it = set.iterator();

        // Let's first check if words that should be there, are:
        while (it.hasNext()) {
            String str = (String) it.next();

            assertTrue(ws.contains(str));
            // And then, let's make sure intern()ing isn't needed:
            assertTrue(ws.contains(""+str));

            char[] strArr = str.toCharArray();
            char[] strArr2 = new char[strArr.length + 4];
            System.arraycopy(strArr, 0, strArr2, 3, strArr.length);
            assertTrue(ws.contains(strArr, 0, str.length()));
            assertTrue(ws.contains(strArr2, 3, str.length() + 3));
        }

        // And then that ones shouldn't be there aren't:
        checkNotFind(ws, "foo");
View Full Code Here

TOP

Related Classes of com.ctc.wstx.util.WordSet

Copyright © 2018 www.massapicom. 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.