Back to project page Profiterole.
The source code is released under:
Apache License
If you think the Android project Profiterole listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package profiterole.waffle; /*from w ww . j av a2 s .c o m*/ import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.List; import java.util.Map.Entry; import profiterole.api.MapReduce; import profiterole.api.Waffle; public class WaffleBackend { /* * Entry { key = "key" value = "value" } */ private WaffleBackend() { throw new AssertionError("can't be here"); } @SuppressWarnings("unchecked") public static void doWaffleData(Waffle<?> waffle) { List<?> list = waffle.getSortedUnModifiableList(); StringBuilder builder = new StringBuilder(); Entry<String, Integer> current = null; for (Object element : list) { current = (Entry<String, Integer>) element; builder.append("Entry { \n key = \"").append(current.getKey()) .append("\" \n").append(" value = \"") .append(current.getValue()).append("\" \n } \n"); } try { BufferedWriter out = new BufferedWriter(new FileWriter("test.txt")); out.write(builder.toString()); out.close(); } catch (IOException e) { System.out.println("TODO exception "); } } public static void main(String[] args) { // String one = System.getProperty("user.dir") +"/OneFile/"; Waffle<?> waffle = MapReduce.perform( new File(System.getProperty("user.dir") + "/MapJobs/"), null); System.out.println(waffle); WaffleBackend.doWaffleData(waffle); } }