Package net.openhft.koloboke.function

Examples of net.openhft.koloboke.function.CharShortPredicate


        map.put((char) 11, (short) 22);
        map.put((char) 12, (short) 23);
        map.put((char) 13, (short) 24);
        map.put((char) 14, (short) 25);
        map.remove((char) 13);
        map.forEachWhile(new CharShortPredicate() {

            @Override
            public boolean test(char first, short second) {
                pairs.add(new Pair(first, second));
                return true;
            }
        });

        Collections.sort(pairs);
        assertEquals(3, pairs.size());
        assertEquals((char) 11, pairs.get(0).k /* keyEpsilon */);
        assertEquals((short) 22, pairs.get(0).v /* valueEpsilon */);
        assertEquals((char) 12, pairs.get(1).k /* keyEpsilon */);
        assertEquals((short) 23, pairs.get(1).v /* valueEpsilon */);
        assertEquals((char) 14, pairs.get(2).k /* keyEpsilon */);
        assertEquals((short) 25, pairs.get(2).v /* valueEpsilon */);

        pairs.clear();
        map.forEachWhile(new CharShortPredicate() {
            int count = 0;

            @Override
            public boolean test(char first, short second) {
                pairs.add(new Pair(first, second));


        map.put((char) 11, (short) 22);
        map.put((char) 12, (short) 23);
        map.put((char) 13, (short) 24);
        map.put((char) 14, (short) 25);
        map.remove((char) 13);
        map.removeIf(new CharShortPredicate() {
            @Override
            public boolean test(char first, short second) {
                return (first % 2) != 0;
            }
        });

TOP

Related Classes of net.openhft.koloboke.function.CharShortPredicate

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.