Package java.util.function

Examples of java.util.function.IntPredicate


        assertIntPredicate(test, UncheckedException.class);
    }

    @Test
    public void testCheckedIntPredicateWithCustomHandler() {
        IntPredicate test = Unchecked.intPredicate(
            i -> {
                throw new Exception("" + i);
            },
            e -> {
                throw new IllegalStateException(e);
View Full Code Here


   
    final int[] upperRow = {-(size+1), -size, -(size-1)};
    final int[] sameRow = {-1, +1};
    final int[] lowerRow = {size-1, size, size+1 };
   
    final IntPredicate basePredicate = x -> x >= 0 && x < totalSize;
   
    for(int i = 0; i < totalSize; ++i)
    {
      final int cur = i;
      final int currentRowIndex = (cur / size) + 1; //plus 1 to make it start indexing at 1
      //all exclusive indices
      final int upperRowIndex = (currentRowIndex - 1) * size;
      final int sameRowIndex = currentRowIndex * size;
      final int lowerRowIndex = (currentRowIndex + 1) * size;
     
      int innerIndex = 0;
      final int bigIndex = i * 8;
     
      innerIndex = findMatches(cur, upperRow, basePredicate.and(x-> x < upperRowIndex), bigIndex, innerIndex, list2);
      innerIndex = findMatches(cur, sameRow, basePredicate.and(x-> x >= upperRowIndex && x < sameRowIndex), bigIndex, innerIndex, list2);
      findMatches(cur, lowerRow, basePredicate.and(x-> x >= sameRowIndex && x < lowerRowIndex), bigIndex, innerIndex, list2);
   
    }
   
    return list2;
  }
View Full Code Here

TOP

Related Classes of java.util.function.IntPredicate

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.