Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Cell


    _book = null;
    _sheet1 = null;
  }
 
  public void testRange1() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range1:range2)"); //E5, range operator
    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E8+1.0E9+1.0E10 +1.0E12+1.0E13+1.0E14 ,
        ((Number)cell.getResult()).doubleValue(), 0d);
  }
View Full Code Here


    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E8+1.0E9+1.0E10 +1.0E12+1.0E13+1.0E14 ,
        ((Number)cell.getResult()).doubleValue(), 0d);
  }

  public void testRange2() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range1 range2)"); //E5, intersect
    assertValue(1.0E5+1.0E6, ((Number)cell.getResult()).doubleValue(), 0d);
  }
View Full Code Here

    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range1 range2)"); //E5, intersect
    assertValue(1.0E5+1.0E6, ((Number)cell.getResult()).doubleValue(), 0d);
  }
 
  public void testRange3() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range1 range3)"); //E5, intersect
    assertEquals(SSError.NULL, cell.getResult());
  }
View Full Code Here

    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range1 range3)"); //E5, intersect
    assertEquals(SSError.NULL, cell.getResult());
  }
 
  public void testRange4() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range2 range3)"); //E5, intersect
    assertValue(1.0E14, ((Number)cell.getResult()).doubleValue(), 0d);
  }
View Full Code Here

    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range2 range3)"); //E5, intersect
    assertValue(1.0E14, ((Number)cell.getResult()).doubleValue(), 0d);
  }
 
  public void testRange5() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range1,range2)"); //E5, union
    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E5+1.0E6 +1.0E9+1.0E10 +1.0E13+1.0E14,
        ((Number)cell.getResult()).doubleValue(), 0d);
  }
View Full Code Here

    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E5+1.0E6 +1.0E9+1.0E10 +1.0E13+1.0E14,
        ((Number)cell.getResult()).doubleValue(), 0d);
  }

  public void testRange6() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM((range1,range2),0)"); //E5, union
    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E5+1.0E6 +1.0E9+1.0E10 +1.0E13+1.0E14,
        ((Number)cell.getResult()).doubleValue(), 0d);
  }
View Full Code Here

    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E5+1.0E6 +1.0E9+1.0E10 +1.0E13+1.0E14,
        ((Number)cell.getResult()).doubleValue(), 0d);
  }
 
  public void testRange7() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM((range1,range3),0)"); //E5, union
    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E14+1.0E15,
        ((Number)cell.getResult()).doubleValue(), 1d);
  }
View Full Code Here

    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6 +1.0E14+1.0E15,
        ((Number)cell.getResult()).doubleValue(), 1d);
  }
 
  public void testRange8() {
    Cell cell = _sheet1.setCellEditText(4, 4, "=SUM(range1,0)"); //E5, union
    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6,
        ((Number)cell.getResult()).doubleValue(), 1d);

    _sheet1.setCellEditText(4, 4, "=SUM(range1,0)"); //E5, union
    assertValue(1d+10d+100d +1.0E4+1.0E5+1.0E6,
        ((Number)cell.getResult()).doubleValue(), 1d);
  }
View Full Code Here

    System.out.println("names="+Objects.toString(names));
    Sheet sheet = (Sheet) book.getSheets().get(0);

    //test single column range
    for (int j = 1; j < 8; ++j) { //A1 ~ A7
      Cell cell = sheet.getCell(j-1,0);
      assertEquals(""+j, cell.getText());
    }
    {
      Cell cell = sheet.getCell(7,0); //A8
      assertEquals("#VALUE!", cell.getText());
    }

    //test single row range
    for (int j = 1; j < 7; ++j) { //A9 ~ F9
      Cell cell = sheet.getCell(8, j-1);
      assertEquals(""+(j*10), cell.getText());
    }
    {
      Cell cell = sheet.getCell(8,6); //G9
      assertEquals("#VALUE!", cell.getText());
    }
   
    //test multiple row and column range
    {
      Cell cell = sheet.getCell(11,0); //A12
      assertEquals("#VALUE!", cell.getText());
    }
   
    //test single cell range
    {
      Cell cell = sheet.getCell(12,0); //A13
      assertEquals("100", cell.getText());
    }
  }
View Full Code Here

    String[] names = book.getNameRangeNames();
    System.out.println("names="+Objects.toString(names));
    Sheet sheet = (Sheet) book.getSheets().get(0);

    {
      Cell cell = sheet.getCell(0,1); //B1
      assertEquals("10", cell.getText());
    }

    {
      Cell cell = sheet.getCell(1,1); //B2
      assertEquals("2", cell.getText());
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Cell

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.