Package etch.util.core.nio

Examples of etch.util.core.nio.History.used()


  public void suggested3() throws Exception
  {
    History h = new History( 0, 10, 5 );
    assertEquals( 0, h.suggested() );
   
    assertTrue( h.used( 10 ) );
    assertEquals( 10, h.getUsed() );
   
    assertEquals( 0, h.suggested() ); // avg(0, 0, 0, 0, 0) == 0
    h.tickle();
    assertEquals( 2, h.suggested() ); // avg(10, 0, 0, 0, 0) == 2
View Full Code Here


    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
   
    assertTrue( h.used( -10 ) );
    assertEquals( 0, h.getUsed() );
   
    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
    h.tickle();
View Full Code Here

  public void suggested4() throws Exception
  {
    History h = new History( 2, 10, 5 );
    assertEquals( 2, h.suggested() );
   
    assertTrue( h.used( 10 ) );
    assertEquals( 10, h.getUsed() );
   
    assertEquals( 2, h.suggested() ); // avg(2, 2, 2, 2, 2) == 2
    h.tickle();
    assertEquals( 3, h.suggested() ); // avg(10, 2, 2, 2, 2) == 3
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.