Package java.io

Examples of java.io.PrintStream.printf()


      }
    }
   
    t2 = System.currentTimeMillis();
   
    out.printf("existant lookup rate %6.2f%n", 500 / ((t2 - t1) / 1000.0));
    out.println("expected hits 500.  Receive hits: " + count);
    bmfr.close();
  }
}
View Full Code Here


    /**
     * @tests java.io.PrintStream#printf(java.lang.String, java.lang.Object...)
     */
    public void test_printfLjava_lang_String$Ljava_lang_Object() {
        PrintStream os = new PrintStream(bos, false);
        os.printf("%s %s", "Hello", "World");
        os.flush();
        ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        byte[] rbytes = new byte[11];
        bis.read(rbytes, 0, rbytes.length);
        assertEquals("Wrote incorrect string", "Hello World",
View Full Code Here

     * @tests java.io.PrintStream#printf(java.util.Locale, java.lang.String,
     *        java.lang.Object...)
     */
    public void test_printfLjava_util_Locale_Ljava_lang_String_$Ljava_lang_Object() {
        PrintStream os = new PrintStream(bos, false);
        os.printf(Locale.US, "%s %s", "Hello", "World");
        os.flush();
        ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        byte[] rbytes = new byte[11];
        bis.read(rbytes, 0, rbytes.length);
        assertEquals("Wrote incorrect string", "Hello World",
View Full Code Here

      bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf2")), new Value(("v" + fi).getBytes()));
    }
   
    long t2 = System.currentTimeMillis();
   
    out.printf("write rate %6.2f\n", vals.size() / ((t2 - t1) / 1000.0));
   
    bmfw.close();
   
    t1 = System.currentTimeMillis();
    FileSKVIterator bmfr = FileOperations.getInstance().openReader(fname, false, fs, conf, acuconf);
View Full Code Here

      }
    }
   
    t2 = System.currentTimeMillis();
   
    out.printf("random lookup rate : %6.2f\n", 5000 / ((t2 - t1) / 1000.0));
    out.println("hits = " + hits);
   
    int count = 0;
   
    t1 = System.currentTimeMillis();
View Full Code Here

      }
    }
   
    t2 = System.currentTimeMillis();
   
    out.printf("existant lookup rate %6.2f\n", 500 / ((t2 - t1) / 1000.0));
    out.println("expected hits 500.  Receive hits: " + count);
    bmfr.close();
  }
}
View Full Code Here

    try {
      Vertex v;
      Edge e;

      PrintStream out = new PrintStream(new FileOutputStream(file, false));
      out.printf("G,%s,%s,%s\n", isDirected(), animator.isEdgeWeightVisible(), animator.isEdgeFlowVisible());

      for(Integer i : vertices.keySet()) {
        v = vertices.get(i);
        out.printf("V,%d,%s,%s,%s,%d,%d\n", v.getId(), animator.getData(v.getId()), animator.getEastText(v.getId()), animator.getSouthText(v.getId()), animator.getX(v.getId()), animator.getY(v.getId()));
      }
View Full Code Here

      PrintStream out = new PrintStream(new FileOutputStream(file, false));
      out.printf("G,%s,%s,%s\n", isDirected(), animator.isEdgeWeightVisible(), animator.isEdgeFlowVisible());

      for(Integer i : vertices.keySet()) {
        v = vertices.get(i);
        out.printf("V,%d,%s,%s,%s,%d,%d\n", v.getId(), animator.getData(v.getId()), animator.getEastText(v.getId()), animator.getSouthText(v.getId()), animator.getX(v.getId()), animator.getY(v.getId()));
      }

      for(Integer i : edges.keySet()) {
        e = edges.get(i);
        out.printf("E,%s,%d,%d,%d,%f,%f,%f\n", e.getClass().getName(),e.getId(), e.getStart().getId(), e.getEnd().getId(), e.getWeight(), e.getFlow(), e.getCapacity());
View Full Code Here

        out.printf("V,%d,%s,%s,%s,%d,%d\n", v.getId(), animator.getData(v.getId()), animator.getEastText(v.getId()), animator.getSouthText(v.getId()), animator.getX(v.getId()), animator.getY(v.getId()));
      }

      for(Integer i : edges.keySet()) {
        e = edges.get(i);
        out.printf("E,%s,%d,%d,%d,%f,%f,%f\n", e.getClass().getName(),e.getId(), e.getStart().getId(), e.getEnd().getId(), e.getWeight(), e.getFlow(), e.getCapacity());
      }

      out.close();
    } catch(FileNotFoundException ex) {
      JOptionPane.showMessageDialog(canvas, "You do not have the necessary permissions to write to this file.", "Unable to Save", JOptionPane.ERROR_MESSAGE);
View Full Code Here

  @Override
  public String toString() {
    ByteArrayOutputStream baoStream = new ByteArrayOutputStream( );
    PrintStream oStream = new PrintStream( baoStream);

    oStream.printf( "VILLAGE: %s (%d,%d)\n", name, coordX, coordY);
    oStream.printf( "Id: %d\n", id);
    oStream.printf( "Url: %s\n", url);
    oStream.println( "");

    if( currentStorageTimestamp.getTime() != 0) {
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.