Package org.codehaus.groovy.runtime.callsite

Examples of org.codehaus.groovy.runtime.callsite.BooleanReturningMethodInvoker.invoke()


            while ( itr.hasNext() ) {
                Path currentPath = itr.next();
                if ((fileType != FileType.FILES && Files.isDirectory(currentPath)) ||
                        (fileType != FileType.DIRECTORIES && Files.isRegularFile(currentPath)))
                {
                    if (bmi.invoke(nameFilter, currentPath.getFileName().toString()))
                        closure.call(currentPath);
                }
            }
        }
    }
View Full Code Here


    public static Collection grep(Object self, Object filter) {
        Collection answer = createSimilarOrDefaultCollection(self);
        BooleanReturningMethodInvoker bmi = new BooleanReturningMethodInvoker("isCase");
        for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext();) {
            Object object = iter.next();
            if (bmi.invoke(filter, object)) {
                answer.add(object);
            }
        }
        return answer;
    }
View Full Code Here

     */
    public static <T> Collection<T> grep(Collection<T> self, Object filter) {
        Collection<T> answer = createSimilarCollection(self);
        BooleanReturningMethodInvoker bmi = new BooleanReturningMethodInvoker("isCase");
        for (T element : self) {
            if (bmi.invoke(filter, element)) {
                answer.add(element);
            }
        }
        return answer;
    }
View Full Code Here

     */
    public static <T> Collection<T> grep(T[] self, Object filter) {
        Collection<T> answer = new ArrayList<T>();
        BooleanReturningMethodInvoker bmi = new BooleanReturningMethodInvoker("isCase");
        for (T element : self) {
            if (bmi.invoke(filter, element)) {
                answer.add(element);
            }
        }
        return answer;
    }
View Full Code Here

        BooleanReturningMethodInvoker bmi = new BooleanReturningMethodInvoker("isCase");
        for (final File currentFile : files) {
            if (fileType == FileType.ANY ||
                    (fileType != FileType.FILES && currentFile.isDirectory()) ||
                    (fileType != FileType.DIRECTORIES && currentFile.isFile())) {
                if (bmi.invoke(nameFilter, currentFile.getName()))
                    closure.call(currentFile);
            }
        }
    }
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.