Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- programming_book
- Software Engineering
- web
- program
- hbase
- France
- hadoop
- agile
- Programming
- Book
- leadership
- history
- management and leadership
- Kuala Lumpur
- django
- UK
- Malaysia
- Spain
- MySQL
- Italy
- comic agile
- RFID
- Java
- Linux
- QT
- management
- Python
- Book review
- ubuntu
- erlang
Archives
- Today
- Total
목록foldLeft (1)
Example functional programming fold left and fold right in java
import java.util.ArrayList; import java.util.List; //http://abel-perez.com/example-functional-programming-fold-left-and public class TestFunctionalSum{ public static int foldLeft(List elements, int seed, Function function){ intaccumulated=seed; for ( final Integer element : elements ){ accumulated=function.apply(element, accumulated); } returnaccumulated; } public static void main(final String[]..
Programming/Java
2011. 4. 30. 04:28