Package etch.util.core.nio

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


    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


  @Test
  public void suggested5() throws Exception
  {
    History h = new History( 0, 10, 0 );
    assertEquals( 0, h.suggested() );
    assertTrue( h.used( 5 ) );
    assertEquals( 0, h.suggested() );
    h.tickle();
    assertEquals( 0, h.suggested() );
  }
 
View Full Code Here

  @Test
  public void used1() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
View Full Code Here

  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
  /** @throws Exception */
  @Test
 
View Full Code Here

  @Test
  public void used2() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 2 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -2 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
View Full Code Here

  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 2 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -2 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
  /** @throws Exception */
  @Test
 
View Full Code Here

  @Test
  public void used3() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 1, 0 );
View Full Code Here

  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 0, 0 );
View Full Code Here

    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
View Full Code Here

    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
  /** @throws Exception */
  @Test
 
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.