Package org.apache.poi.ss.formula.functions.Offset

Examples of org.apache.poi.ss.formula.functions.Offset.LinearOffsetRange


    confirmDoubleConvert(-2.00, -2);
    confirmDoubleConvert(-2.01, -3);
  }

  public void testLinearOffsetRange() {
    LinearOffsetRange lor;

    lor = new LinearOffsetRange(3, 2);
    assertEquals(3, lor.getFirstIndex());
    assertEquals(4, lor.getLastIndex());
    lor = lor.normaliseAndTranslate(0); // expected no change
    assertEquals(3, lor.getFirstIndex());
    assertEquals(4, lor.getLastIndex());

    lor = lor.normaliseAndTranslate(5);
    assertEquals(8, lor.getFirstIndex());
    assertEquals(9, lor.getLastIndex());

    // negative length

    lor = new LinearOffsetRange(6, -4).normaliseAndTranslate(0);
    assertEquals(3, lor.getFirstIndex());
    assertEquals(6, lor.getLastIndex());


    // bounds checking
    lor = new LinearOffsetRange(0, 100);
    assertFalse(lor.isOutOfBounds(0, 16383));
    lor = lor.normaliseAndTranslate(16300);
    assertTrue(lor.isOutOfBounds(0, 16383));
    assertFalse(lor.isOutOfBounds(0, 65535));
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.formula.functions.Offset.LinearOffsetRange

Copyright © 2018 www.massapicom. 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.