Package org.mcavallo.opencloud.formatters

Examples of org.mcavallo.opencloud.formatters.HTMLFormatter


       
        return cloudMap;
    }
   
    public void printCloudsHTML(Map<Integer,Cloud> cloudMap) {
        HTMLFormatter formatter = new HTMLFormatter();
       
        System.out.println("<h2>KMeans k=" + cloudMap.size() + "</h2>");
        for (Map.Entry<Integer, Cloud> entry : cloudMap.entrySet()) {
            Integer clusterId = entry.getKey();
            formatter.setHtmlTemplateTop("<h3>Cluster ID: &nbsp;" + clusterId + "</h3>");
            System.out.println(formatter.html(entry.getValue()));
        }
    }
View Full Code Here


            System.out.println(formatter.html(entry.getValue()));
        }
    }
   
    public void writeCloudsHTML(Map<Integer,Cloud> cloudMap, String outputPath) {
        HTMLFormatter formatter = new HTMLFormatter();
       
        BufferedWriter writer = null;
        try {
            writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputPath), "UTF-8"));
            writer.write("<h2>KMeans k=" + cloudMap.size() + "</h2>\n");
            for (Map.Entry<Integer, Cloud> entry : cloudMap.entrySet()) {
                Integer clusterId = entry.getKey();
                formatter.setHtmlTemplateTop("<h3>Cluster ID: &nbsp;" + clusterId + "</h3>");
                writer.write(formatter.html(entry.getValue()));
                writer.newLine();
            }
        } catch (UnsupportedEncodingException e) {
            LOG.error("UTF-8 is unsupported?", e);
        } catch (FileNotFoundException e) {
View Full Code Here

TOP

Related Classes of org.mcavallo.opencloud.formatters.HTMLFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.