Package javolution.util.function

Basic functions for lambda expressions and method references.

See: Description

Package javolution.util.function Description

Basic functions for lambda expressions and method references.

Most often, functions do not have a state and can be called concurrently, as indicated by the annotation Parallelizable.

Functions may take an arbitrary number of arguments through the use of multi-variables or no argument at all using the standard Void class.

// Function populating a list of integer and returning void.
Function<MultiVariable<List<Integer>, Integer>, Void> fill = new Function<>() {
   public Void apply(MultiVariable<List<Integer>, Integer> params) {
       List<Integer> list = params.getLeft();
       for (int i = 0, n = params.getRight(); i < n; i++) {
          list.add(i);
       }
       return null;
   }
};
FastTable<Integer> list = new FastTable<Integer>();
fill.apply(new MultiVariable(list, 100)); // Populates with numbers [0 .. 100[

Copyright © 2005-2013 Javolution. All Rights Reserved.