Package java.io

Examples of java.io.PrintStream.printf()


  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) {
        oStream.println( "Storage: " + dateFormat.format( currentStorageTimestamp));
View Full Code Here


    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) {
        oStream.println( "Storage: " + dateFormat.format( currentStorageTimestamp));
            for( ResourceType r : ResourceType.values())
View Full Code Here

    if( currentStorageTimestamp.getTime() != 0) {
        oStream.println( "Storage: " + dateFormat.format( currentStorageTimestamp));
            for( ResourceType r : ResourceType.values())
            {
                oStream.printf( "  - %s=%d/%d (%d units/hour)\r", r.toString(), currentStorage.get( r), maximumStorage.get( r), productionRate.get( r));
            }
            oStream.println( "");
        }
   
View Full Code Here

        if( constructionQueueTimestamp.getTime() != 0) {
            oStream.println( "Construction Queue: " + dateFormat.format( constructionQueueTimestamp));
            for( ArrayList<Object> c : constructionQueue)
            {
                oStream.printf( "  - updating %s to level %s, ready at %s after %s hours\n",
                        c.get( 0), c.get( 1), c.get( 3), c.get( 2));
            }
            oStream.println( "");
        }
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

      bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf2")), new Value(("v" + fi).getBytes(Constants.UTF8)));
    }
   
    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

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.