Package org.jfree.data

Examples of org.jfree.data.DefaultKeyedValues2D


   
    /**
     * Some basic checks for the getColumnKey() method.
     */
    public void testGetColumnKey() {
        DefaultKeyedValues2D d = new DefaultKeyedValues2D();
        boolean pass = false;
        try {
            d.getColumnKey(0);
        }
        catch (IndexOutOfBoundsException e) {
            pass = true;
        }
        assertTrue(pass);
        d.addValue(new Double(1.0), "R1", "C1");
        d.addValue(new Double(1.0), "R1", "C2");
        assertEquals("C1", d.getColumnKey(0));
        assertEquals("C2", d.getColumnKey(1));
    }
View Full Code Here


   
    /**
     * Some basic checks for the removeValue() method.
     */
    public void testRemoveValue() {
        DefaultKeyedValues2D d = new DefaultKeyedValues2D();
        d.removeValue("R1", "C1");
        d.addValue(new Double(1.0), "R1", "C1");
        d.removeValue("R1", "C1");
        assertEquals(0, d.getRowCount());
        assertEquals(0, d.getColumnCount());
       
        d.addValue(new Double(1.0), "R1", "C1");
        d.addValue(new Double(2.0), "R2", "C1");
        d.removeValue("R1", "C1");
        assertEquals(new Double(2.0), d.getValue(0, 0));
    }
View Full Code Here

   
    /**
     * A test for bug 1690654.
     */
    public void testRemoveValueBug1690654() {
        DefaultKeyedValues2D d = new DefaultKeyedValues2D();
        d.addValue(new Double(1.0), "R1", "C1");
        d.addValue(new Double(2.0), "R2", "C2");
        assertEquals(2, d.getColumnCount());
        assertEquals(2, d.getRowCount());
        d.removeValue("R2", "C2");
        assertEquals(1, d.getColumnCount());
        assertEquals(1, d.getRowCount());
        assertEquals(new Double(1.0), d.getValue(0, 0));
    }
View Full Code Here

   
    /**
     * Some basic checks for the removeRow() method.
     */
    public void testRemoveRow() {
        DefaultKeyedValues2D d = new DefaultKeyedValues2D();
        boolean pass = false;
        try {
            d.removeRow(0);
        }
        catch (IndexOutOfBoundsException e) {
            pass = true;
        }
        assertTrue(pass);       
View Full Code Here

   
    /**
     * Some basic checks for the removeColumn(Comparable) method.
     */
    public void testRemoveColumnByKey() {
      DefaultKeyedValues2D d = new DefaultKeyedValues2D();
      d.addValue(new Double(1.0), "R1", "C1");
      d.addValue(new Double(2.0), "R2", "C2");
      d.removeColumn("C2");
      d.addValue(new Double(3.0), "R2", "C2");
      assertEquals(3.0, d.getValue("R2", "C2").doubleValue(), EPSILON);
     
      // check for unknown column
      boolean pass = false;
      try {
        d.removeColumn("XXX");
      }
      catch (UnknownKeyException e) {
        pass = true;
      }
      assertTrue(pass);
View Full Code Here

    /**
     * Creates a new empty CategoryTableXYDataset.
     */
    public CategoryTableXYDataset() {
        this.values = new DefaultKeyedValues2D(true);
        this.intervalDelegate = new IntervalXYDelegate(this);
        addChangeListener(this.intervalDelegate);
    }
View Full Code Here

    /**
     * Creates a new (empty) dataset.
     */
    public DefaultCategoryDataset() {
        this.data = new DefaultKeyedValues2D();
    }
View Full Code Here

            throw new IllegalArgumentException("Null 'zone' argument.");
        }
        if (locale == null) {
            throw new IllegalArgumentException("Null 'locale' argument.");
        }
        this.values = new DefaultKeyedValues2D(true);
        this.workingCalendar = Calendar.getInstance(zone, locale);
        this.xPosition = TimePeriodAnchor.START;
    }
View Full Code Here

    /**
     * Creates a new empty CategoryTableXYDataset.
     */
    public CategoryTableXYDataset() {
        this.values = new DefaultKeyedValues2D(true);
        this.intervalDelegate = new IntervalXYDelegate(this);
        addChangeListener(this.intervalDelegate);
    }
View Full Code Here

     */
    public WaferMapDataset(int maxChipX, int maxChipY, Number chipSpace) {

        this.maxValue = Double.NEGATIVE_INFINITY;
        this.minValue = Double.POSITIVE_INFINITY;
        this.data = new DefaultKeyedValues2D();

        this.maxChipX = maxChipX;
        this.maxChipY = maxChipY;
        if (chipSpace == null) {
            this.chipSpace = DEFAULT_CHIP_SPACE;
View Full Code Here

TOP

Related Classes of org.jfree.data.DefaultKeyedValues2D

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.