/*
   * BooleanSupplier. Supplier of boolean-valued results.
   * IntSupplier. Supplier of int-valued results.
   * LongSupplier. Supplier of long-valued results.
   * DoubleSupplier. Supplier of double-valued results.
   */
  public static void main(String[] args) {
    BooleanSupplier booleanSupplier = () -> Boolean.TRUE;
    IntSupplier intSupplier = () -> new Integer(0);
    LongSupplier longSupplier = () -> new Long(0);
    DoubleSupplier doubleSupplier = () -> new Double(0);

    System.out.println(booleanSupplier.getAsBoolean());
    System.out.println(intSupplier.getAsInt());
    System.out.println(longSupplier.getAsLong());
    System.out.println(doubleSupplier.getAsDouble());
  }
Ejemplo n.º 2
0
 /** Stop the stopwatch, the resolution time is fixed. */
 public void stopStopwatch() {
   timeCount = currentNanoTime.getAsLong();
   currentNanoTime = () -> timeCount;
 }
Ejemplo n.º 3
0
 @Override
 public long getTimeCountInNanoSeconds() {
   timeCount = currentNanoTime.getAsLong();
   return super.getTimeCountInNanoSeconds();
 }