Package org.jfree.data.category

Examples of org.jfree.data.category.DefaultIntervalCategoryDataset


    /**
     * Some checks for the getColumnIndex() method.
     */
    public void testGetColumnIndex() {
        // check an empty dataset
        DefaultIntervalCategoryDataset empty
                = new DefaultIntervalCategoryDataset(new double[0][0],
                        new double[0][0]);
        assertEquals(-1, empty.getColumnIndex("ABC"));
    }
View Full Code Here


    /**
     * Some checks for the setCategoryKeys() method.
     */
    public void testSetCategoryKeys() {
        // check an empty dataset
        DefaultIntervalCategoryDataset empty
                = new DefaultIntervalCategoryDataset(new double[0][0],
                        new double[0][0]);
        boolean pass = true;
        try {
            empty.setCategoryKeys(new String[0]);
        }
        catch (RuntimeException e) {
            pass = false;
        }
        assertTrue(pass);
View Full Code Here

    /**
     * Some checks for the getColumnKeys() method.
     */
    public void testGetColumnKeys() {
        // check an empty dataset
        DefaultIntervalCategoryDataset empty
                = new DefaultIntervalCategoryDataset(new double[0][0],
                        new double[0][0]);
        List keys = empty.getColumnKeys();
        assertEquals(0, keys.size());
    }
View Full Code Here

    /**
     * Some checks for the getRowKeys() method.
     */
    public void testGetRowKeys() {
        // check an empty dataset
        DefaultIntervalCategoryDataset empty
                = new DefaultIntervalCategoryDataset(new double[0][0],
                        new double[0][0]);
        List keys = empty.getRowKeys();
        assertEquals(0, keys.size());
    }
View Full Code Here

    /**
     * Some checks for the getColumnCount() method.
     */
    public void testGetColumnCount() {
        // check an empty dataset
        DefaultIntervalCategoryDataset empty
                = new DefaultIntervalCategoryDataset(new double[0][0],
                        new double[0][0]);
        assertEquals(0, empty.getColumnCount());
    }
View Full Code Here

    /**
     * Some checks for the getRowCount() method.
     */
    public void testGetRowCount() {
        // check an empty dataset
        DefaultIntervalCategoryDataset empty
                = new DefaultIntervalCategoryDataset(new double[0][0],
                        new double[0][0]);
        assertEquals(0, empty.getColumnCount());
    }
View Full Code Here

        ends[0][2] = new Double(6.0);
        ends[1][0] = new Double(16.0);
        ends[1][1] = new Double(15.0);
        ends[1][2] = new Double(14.0);

        DefaultIntervalCategoryDataset d = new DefaultIntervalCategoryDataset(
                starts, ends);
        Range r = DatasetUtilities.iterateRangeBounds(d, false);
        assertEquals(4.0, r.getLowerBound(), EPSILON);
        assertEquals(16.0, r.getUpperBound(), EPSILON);
        r = DatasetUtilities.iterateRangeBounds(d, true);
View Full Code Here

    DatasetProducer mostVisitedPagesChart = (DatasetProducer) action.getMostVisitedPagestimeData();
    TopContentsCDP topContents = (TopContentsCDP) action.getTopContentsDataset();//request.getAttribute("TopContents");
    assertNotNull(accessChart);
    assertNotNull(mostVisitedPagesChart);
    assertNotNull(topContents);
    DefaultIntervalCategoryDataset data = (DefaultIntervalCategoryDataset) topContents.produceDataset(null);
    List categories = data.getCategories();
    assertTrue(categories.size()>0);
  }
View Full Code Here

  public boolean hasExpired(Map params, Date since) {
    return (System.currentTimeMillis() - since.getTime())  > 5000;
  }
 
  public Object produceDataset(Map params) throws DatasetProduceException {
    DefaultIntervalCategoryDataset ds = null;
    try{
      ds = getDefaultIntervalCategoryDataset();
    } catch (Throwable e) {
      throw new DatasetProduceException("An error occurred generating the DefaultIntervalCategoryDataset object " + this.getClass().getName());
    }
View Full Code Here

    data.add(hits);
    return data;
  }
 
  private DefaultIntervalCategoryDataset getDefaultIntervalCategoryDataset() throws ApsSystemException {
    DefaultIntervalCategoryDataset ds = null;
    try {
      Map<String, Integer> result = this.getResultset();
      List data = this.getDataFromResultset(result);
      String[] categories = (String[]) data.get(0);
      Integer[] hits = (Integer[]) data.get(1);
      final Integer[][] startValues = new Integer[_seriesNames.length][categories.length];
      final Integer[][] endValues = new Integer[_seriesNames.length][categories.length];
      int i;
      for (int series = 0; series < _seriesNames.length; series++) {
        for ( i = 0; i < categories.length; i++) {
          startValues[series][i] = new Integer(0);
          endValues[series][i] = hits[i];
        }
      }
      ds = new DefaultIntervalCategoryDataset(_seriesNames, categories, startValues, endValues);    
    } catch (Throwable e) {
      throw new ApsSystemException("An error occurred getting statistics data ", e);
    }
    return ds;   
  }
View Full Code Here

TOP

Related Classes of org.jfree.data.category.DefaultIntervalCategoryDataset

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.