Package org.xcsp.common
Interface FunctionalInterfaces.Intx1Predicate
-
- Enclosing interface:
- FunctionalInterfaces
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface FunctionalInterfaces.Intx1Predicate
Represents a predicate (boolean-valued function) of one integer argument. This is a functional interface whose functional method istest(int)
.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> List<T>
select(T[] vars, FunctionalInterfaces.Intx1Predicate p, List<T> list)
Returns the specified list after any variable, at indexi
, that satisfies the specified predicate have been added to it.boolean
test(int i)
Returnstrue
iff the predicate accepts the specified integer
-
-
-
Method Detail
-
test
boolean test(int i)
Returnstrue
iff the predicate accepts the specified integer- Parameters:
i
- an integer- Returns:
true
iff the predicate accepts the specified integer
-
select
static <T> List<T> select(T[] vars, FunctionalInterfaces.Intx1Predicate p, List<T> list)
Returns the specified list after any variable, at indexi
, that satisfies the specified predicate have been added to it. Note thatnull
values are simply discarded, if ever present.- Parameters:
vars
- a 1-dimensional array of variablesp
- a predicate allowing us to test if a variable at indexi
must be added to the listlist
- a list where selected variables are added- Returns:
- the specified list, after selected variables have been added
-
-