Example usage for org.jfree.data UnknownKeyException UnknownKeyException

List of usage examples for org.jfree.data UnknownKeyException UnknownKeyException

Introduction

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

Prototype

public UnknownKeyException(String message) 

Source Link

Document

Creates a new exception.

Usage

From source file:org.jfree.data.category.DefaultIntervalCategoryDataset.java

/**
 * Returns the start data value for one category in a series.
 *
 * @param series  the required series./* w  ww . j av a  2 s. co  m*/
 * @param category  the required category.
 *
 * @return The start data value for one category in a series
 *         (possibly <code>null</code>).
 *
 * @see #getStartValue(int, int)
 */
@Override
public Number getStartValue(Comparable series, Comparable category) {
    int seriesIndex = getSeriesIndex(series);
    if (seriesIndex < 0) {
        throw new UnknownKeyException("Unknown 'series' key.");
    }
    int itemIndex = getColumnIndex(category);
    if (itemIndex < 0) {
        throw new UnknownKeyException("Unknown 'category' key.");
    }
    return getStartValue(seriesIndex, itemIndex);
}

From source file:org.jfree.data.gantt.SlidingGanttCategoryDataset.java

/**
 * Returns the number of sub-intervals for a given item.
 *
 * @param rowKey  the row key.//from w w w.  jav  a2s. co m
 * @param columnKey  the column key.
 *
 * @return The sub-interval count.
 *
 * @see #getSubIntervalCount(int, int)
 */
@Override
public int getSubIntervalCount(Comparable rowKey, Comparable columnKey) {
    int r = getRowIndex(rowKey);
    int c = getColumnIndex(columnKey);
    if (c != -1) {
        return this.underlying.getSubIntervalCount(r, c + this.firstCategoryIndex);
    } else {
        throw new UnknownKeyException("Unknown columnKey: " + columnKey);
    }
}

From source file:org.jfree.data.gantt.SlidingGanttCategoryDataset.java

/**
 * Returns the start value for the interval for a given series and category.
 *
 * @param rowKey  the series key./*from w  w w.j  a  va  2s  .c o  m*/
 * @param columnKey  the category key.
 *
 * @return The start value (possibly <code>null</code>).
 *
 * @see #getEndValue(Comparable, Comparable)
 */
@Override
public Number getStartValue(Comparable rowKey, Comparable columnKey) {
    int r = getRowIndex(rowKey);
    int c = getColumnIndex(columnKey);
    if (c != -1) {
        return this.underlying.getStartValue(r, c + this.firstCategoryIndex);
    } else {
        throw new UnknownKeyException("Unknown columnKey: " + columnKey);
    }
}

From source file:org.jfree.data.category.DefaultIntervalCategoryDataset.java

/**
 * Returns the end data value for one category in a series.
 *
 * @param series  the required series./*from   ww  w  . j a va2 s. c o  m*/
 * @param category  the required category.
 *
 * @return The end data value for one category in a series (null possible).
 *
 * @see #getEndValue(int, int)
 */
@Override
public Number getEndValue(Comparable series, Comparable category) {
    int seriesIndex = getSeriesIndex(series);
    if (seriesIndex < 0) {
        throw new UnknownKeyException("Unknown 'series' key.");
    }
    int itemIndex = getColumnIndex(category);
    if (itemIndex < 0) {
        throw new UnknownKeyException("Unknown 'category' key.");
    }
    return getEndValue(seriesIndex, itemIndex);
}

From source file:org.jfree.data.gantt.SlidingGanttCategoryDataset.java

/**
 * Returns the end value for the interval for a given series and category.
 *
 * @param rowKey  the series key.//  ww w.j a v  a2  s  .c  om
 * @param columnKey  the category key.
 *
 * @return The end value (possibly <code>null</code>).
 *
 * @see #getStartValue(Comparable, Comparable)
 */
@Override
public Number getEndValue(Comparable rowKey, Comparable columnKey) {
    int r = getRowIndex(rowKey);
    int c = getColumnIndex(columnKey);
    if (c != -1) {
        return this.underlying.getEndValue(r, c + this.firstCategoryIndex);
    } else {
        throw new UnknownKeyException("Unknown columnKey: " + columnKey);
    }
}