Android Open Source - Profiterole Waffle Backend






From Project

Back to project page Profiterole.

License

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.

Java Source Code

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);
  }
}




Java Source Code List

profiterole.android.DictionaryScreen.java
profiterole.android.SearchScreen.java
profiterole.api.MapReduce.java
profiterole.api.OnUpdateStatusCallback.java
profiterole.api.Waffle.java
profiterole.mapreduce.MapCallback.java
profiterole.mapreduce.MapReduceService.java
profiterole.mapreduce.Reducer.java
profiterole.mapreduce.Splitter.java
profiterole.samples.Driver.java
profiterole.samples.PrintPromptListener.java
profiterole.samples.REPL.java
profiterole.waffle.InvertedIndex.java
profiterole.waffle.WaffleBackend.java
profiterole.waffle.WaffleImpl.java
profiterole.waffle.WaffleUtils.java