Java File Save saveStringDoubleMap(Map map, int dim, PrintStream out)

Here you can find the source of saveStringDoubleMap(Map map, int dim, PrintStream out)

Description

save String Double Map

License

Open Source License

Declaration

public static void saveStringDoubleMap(Map<String, double[]> map, int dim, PrintStream out) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.PrintStream;

import java.util.Map;
import java.util.Map.Entry;

public class Main {
    public static void saveStringDoubleMap(Map<String, double[]> map, int dim, PrintStream out) {
        out.println(map.size() + " " + dim);
        for (Entry<String, double[]> entry : map.entrySet()) {
            out.println(entry.getKey());
            for (int i = 0; i < dim; i++) {
                out.print(entry.getValue()[i]);
                if (i != dim - 1) {
                    out.print(" ");
                }/*from  w w  w  . j  av  a 2  s . c om*/
            }
            out.println();
        }
    }
}

Related

  1. saveFile(String where)
  2. saveInputToOutput(InputStream is, OutputStream os)
  3. saveIntArray(int[] array, PrintStream out)
  4. SaveIntFile(int[] list, String filename)
  5. saveStreamAsString(InputStream is)
  6. saveToInputStream(ByteArrayInputStream in, OutputStream out)
  7. saveTrecOneEntry(BufferedWriter trecFile, String topicId, String docId, int docPos, float score, String runId)