MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / select

Method select

src/main/java/wyil/check/FlowTypeCheck.java:2560–2569  ·  view source on GitHub ↗
(List<T> items, Predicate<T> critereon)

Source from the content-addressed store, hash-verified

2558 }
2559
2560 private static <T> List<T> select(List<T> items, Predicate<T> critereon) {
2561 ArrayList<T> result = new ArrayList<>();
2562 for (int i = 0; i != items.size(); ++i) {
2563 T ith = items.get(i);
2564 if (critereon.test(ith)) {
2565 result.add(ith);
2566 }
2567 }
2568 return result;
2569 }
2570
2571 /**
2572 * Determine whether a cast from one type to another is "sensible". That is,

Callers 4

pushInvokeMethod · 0.95
pullInvokeMethod · 0.95
filterOnIntArrayMethod · 0.95

Calls 3

sizeMethod · 0.65
getMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected