bendingthejavaspoon.com
Bending the Java spoon: March 2010
http://www.bendingthejavaspoon.com/2010_03_01_archive.html
Bending the Java spoon. Op4j news and example recipes. Adding an element to an array at a specific position. Valid since: op4j 1.0. Insert a new element into an array at a specific position. Variable, of type. Minerals = ARRAY [ "Talc", "Quartz", "Diamond" ]. And we want to add "Fluorite". At the second position of the array, as it is harder than talc but softer than quartz:. Minerals = ARRAY [ "Talc", "Fluorite", "Quartz", "Diamond" ]. Minerals = Op.on(minerals).insert(1 ,"Fluorite").get();. If we wante...
op4j.org
op4j: bending the Java spoon - The Basics
http://www.op4j.org/basics.html
Last Published: 19 May 2012. Features: a general overview. Here are some quick details about what op4j can do:. Apply functions on objects. Including more than 200 predefined functions for data conversion, string handling, calendar operation, math operations, etc. Manage structures (arrays, lists, maps and sets), including:. Easily creating them from their elements (building). Modifying them (adding / removing / replacing elements). Iterating them, applying functions on each element. They allow the defin...
bendingthejavaspoon.com
Bending the Java spoon: April 2010
http://www.bendingthejavaspoon.com/2010_04_01_archive.html
Bending the Java spoon. Op4j news and example recipes. Building a map from a list by executing functions on its elements. Valid since: op4j 1.0. Build a map by iterating the elements of a list and executing two functions on each of them: one for obtaining the key of the corresponding entry, and another one for obtaining the value. Class looks like this:. And we have a. Variable containing data about some countries:. Which we want to transform into a. Map String,Integer populationByCountry = Op.on(cou...