Example usage for org.jfree.data DefaultKeyedValues2D removeColumn

List of usage examples for org.jfree.data DefaultKeyedValues2D removeColumn

Introduction

In this page you can find the example usage for org.jfree.data DefaultKeyedValues2D removeColumn.

Prototype

public void removeColumn(Comparable columnKey) 

Source Link

Document

Removes a column from the table.

Usage

From source file:org.jfree.data.DefaultKeyedValues2DTest.java

/**
 * Some basic checks for the removeColumn(Comparable) method.
 *///from   w  w w  .ja v  a  2 s .co  m
@Test
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);
}