Package groovy.lang

Examples of groovy.lang.IntRange


        assertEquals("substring(1,3)", object.substring(1, 3), value);
    }

    public void testListGetWithRange() throws Throwable {
        List list = Arrays.asList(new Object[]{"a", "b", "c"});
        Object range = new IntRange(true, 0, 2);
        Object value = invoke(list, "getAt", range);
        assertTrue("Returned List: " + value, value instanceof List);
        List retList = (List) value;
        assertEquals("List size", 3, retList.size());
    }
View Full Code Here


        // case, we need to reverse them and make sure the range's 'reverse'
        // property is correct.
        // TODO We should probably use DefaultGroovyMethodsSupport.subListBorders(),
        // but that's protected and unavailable to us.
        if (from > to) {
            r = r.isReverse() ? new IntRange(to, from) : new IntRange(from, to);
            from = r.getFromInt();
            to = r.getToInt();
        }

        // Copy the required nodes into a new list.
View Full Code Here

            return tfa;
        }

        private static IntRange getNormalizeRange(Map options) {
            IntRange norm = (IntRange) MapUtils.getObject(options, "normalize");
            if (norm == null) {
                norm = (IntRange) MapUtils.getObject(options, "normalise");
            }
            return norm;
        }
View Full Code Here

TOP

Related Classes of groovy.lang.IntRange

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.