- All Superinterfaces:
IntFunction<Object>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines an interface for conveniently accessing objects by integer indices. For instance,
in the context of an array of objects
Object[] arr, an implementation of
IntToValue could be represented as IntToValue itv = i -> arr[i];.-
Method Summary
Methods inherited from interface java.util.function.IntFunction
apply
-
Method Details
-
get
default <T> T get(int i) Retrieves the value at the specified index with the expected return type.- Type Parameters:
T- the type of the value to retrieve.- Parameters:
i- the index of the value to retrieve- Returns:
- the value at the specified index, cast to the declared type
-
get
Retrieves the value at the specified index with the expected return type.- Type Parameters:
T- the type of the value to retrieve.- Parameters:
i- the index of the value to retrieveignored- the class of the value to retrieve- Returns:
- the value at the specified index, cast to the declared type
-