Package java.io

Examples of java.io.PrintWriter.printf()


        pw.println("graph g {");
        String vertexLabel = null;
        for (int v : g.vertices()) {
            pw.print("\t" + v);
            if (vertexLabels != null && (vertexLabel = vertexLabels.get(v)) != null) {
                pw.printf(" [label=\"%s\"]", vertexLabel);
            }
            pw.println(';');
        }
        for (Edge e : g.edges()) {
            pw.printf("\t%d -- %d\n", e.from(), e.to());
View Full Code Here


                pw.printf(" [label=\"%s\"]", vertexLabel);
            }
            pw.println(';');
        }
        for (Edge e : g.edges()) {
            pw.printf("\t%d -- %d\n", e.from(), e.to());
        }
        pw.println("}");
        pw.close();
    }
View Full Code Here

        pw.println("digraph g {");
        String vertexLabel = null;
        for (int v : g.vertices()) {
            pw.print("\t" + v);
            if (vertexLabels != null && (vertexLabel = vertexLabels.get(v)) != null) {
                pw.printf(" [label=\"%s\"]", vertexLabel);
            }
            pw.println(';');
        }
        for (DirectedEdge e : g.edges()) {
            pw.printf("\t%d -> %d\n", e.from(), e.to());
View Full Code Here

                pw.printf(" [label=\"%s\"]", vertexLabel);
            }
            pw.println(';');
        }
        for (DirectedEdge e : g.edges()) {
            pw.printf("\t%d -> %d\n", e.from(), e.to());
        }
        if (!groups.isEmpty()) {
            for (Set<Integer> group : groups) {
                pw.print("\t{ rank=same; ");
                for (Integer i : group) {
View Full Code Here

      OutputStream to = new FileOutputStream(filepath);
      writeScreenShot(to);
      to.close();
    } catch(FileNotFoundException e){
      PrintWriter stdErr = this.parent.getCallBackEnv().getRascalContext().getStdErr();
      stdErr.printf("Could not write to " + filepath + "\n Reason " + e.getMessage());
    } catch (IOException e) {
      PrintWriter stdErr = this.parent.getCallBackEnv().getRascalContext().getStdErr();
      stdErr.printf("Could not write to " + filepath + "\n Reason " + e.getMessage());
    }
  }
View Full Code Here

    } catch(FileNotFoundException e){
      PrintWriter stdErr = this.parent.getCallBackEnv().getRascalContext().getStdErr();
      stdErr.printf("Could not write to " + filepath + "\n Reason " + e.getMessage());
    } catch (IOException e) {
      PrintWriter stdErr = this.parent.getCallBackEnv().getRascalContext().getStdErr();
      stdErr.printf("Could not write to " + filepath + "\n Reason " + e.getMessage());
    }
  }

 
  public void addSWTElement(Control c) {
View Full Code Here

        maxURL = sz;
      nTicks += e.getValue().getTicks();
    }
    PrintWriter out = eval.getStdOut();
    String URLFormat = "%" + maxURL + "s";
    out.printf("PROFILE: %d data points, %d ticks, tick = %d milliSecs\n", data.size(), nTicks, resolution);
    out.printf(URLFormat + "%8s%9s  %s\n", " Source File", "Ticks", "%", "Source");

    for(Map.Entry<ISourceLocation, Count> e : sortedData){
      String L = e.getKey().getURI().toString();
View Full Code Here

      nTicks += e.getValue().getTicks();
    }
    PrintWriter out = eval.getStdOut();
    String URLFormat = "%" + maxURL + "s";
    out.printf("PROFILE: %d data points, %d ticks, tick = %d milliSecs\n", data.size(), nTicks, resolution);
    out.printf(URLFormat + "%8s%9s  %s\n", " Source File", "Ticks", "%", "Source");

    for(Map.Entry<ISourceLocation, Count> e : sortedData){
      String L = e.getKey().getURI().toString();

      int ticks = e.getValue().getTicks();
View Full Code Here

      int ticks = e.getValue().getTicks();
      double perc = (ticks * 100.0)/nTicks;

      String source = String.format("%s", e.getKey().toString());

      out.printf(URLFormat + "%8d%8.1f%%  %s\n", L, ticks, perc, source);
    }
   
    // Make sure that our output is seen:
    out.flush();
  }
View Full Code Here

        synchronized(out) {
            StackTraceElement el = getLine();
            Formatter formatter = new Formatter();
            try {
                String location = formatter.format("(%s:%d)", el.getFileName(), el.getLineNumber()).toString();
                out.printf("vlcj: %-46s | %-5s | %s%n", location, level, format(msg, args));
                out.flush();
                if(t != null) {
                    PrintWriter err = INSTANCE.err;
                    err.printf("vlcj: %-46s | %-5s | %s%n", location, level, t.getMessage());
                    err.flush();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.