001/* ===========================================================
002 * JFreeChart : a free chart library for the Java(tm) platform
003 * ===========================================================
004 *
005 * (C) Copyright 2000-2022, by David Gilbert and Contributors.
006 *
007 * Project Info:  http://www.jfree.org/jfreechart/index.html
008 *
009 * This library is free software; you can redistribute it and/or modify it
010 * under the terms of the GNU Lesser General Public License as published by
011 * the Free Software Foundation; either version 2.1 of the License, or
012 * (at your option) any later version.
013 *
014 * This library is distributed in the hope that it will be useful, but
015 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
016 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
017 * License for more details.
018 *
019 * You should have received a copy of the GNU Lesser General Public
020 * License along with this library; if not, write to the Free Software
021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
022 * USA.
023 *
024 * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 
025 * Other names may be trademarks of their respective owners.]
026 *
027 * -------------------------
028 * GanttCategoryDataset.java
029 * -------------------------
030 * (C) Copyright 2003-2022, by David Gilbert.
031 *
032 * Original Author:  David Gilbert;
033 * Contributor(s):   -;
034 *
035 */
036
037 package org.jfree.data.gantt;
038
039import org.jfree.data.category.IntervalCategoryDataset;
040
041/**
042 * An extension of the {@link IntervalCategoryDataset} interface that adds
043 * support for multiple sub-intervals.
044 */
045public interface GanttCategoryDataset<R extends Comparable<R>, C extends Comparable<C>> 
046        extends IntervalCategoryDataset<R, C> {
047
048    /**
049     * Returns the percent complete for a given item.
050     *
051     * @param row  the row index (zero-based).
052     * @param column  the column index (zero-based).
053     *
054     * @return The percent complete.
055     *
056     * @see #getPercentComplete(Comparable, Comparable)
057     */
058    Number getPercentComplete(int row, int column);
059
060    /**
061     * Returns the percent complete for a given item.
062     *
063     * @param rowKey  the row key.
064     * @param columnKey  the column key.
065     *
066     * @return The percent complete.
067     *
068     * @see #getPercentComplete(int, int)
069     */
070    Number getPercentComplete(R rowKey, C columnKey);
071
072    /**
073     * Returns the number of sub-intervals for a given item.
074     *
075     * @param row  the row index (zero-based).
076     * @param column  the column index (zero-based).
077     *
078     * @return The sub-interval count.
079     *
080     * @see #getSubIntervalCount(Comparable, Comparable)
081     */
082    int getSubIntervalCount(int row, int column);
083
084    /**
085     * Returns the number of sub-intervals for a given item.
086     *
087     * @param rowKey  the row key.
088     * @param columnKey  the column key.
089     *
090     * @return The sub-interval count.
091     *
092     * @see #getSubIntervalCount(int, int)
093     */
094    int getSubIntervalCount(R rowKey, C columnKey);
095
096    /**
097     * Returns the start value of a sub-interval for a given item.
098     *
099     * @param row  the row index (zero-based).
100     * @param column  the column index (zero-based).
101     * @param subinterval  the sub-interval index (zero-based).
102     *
103     * @return The start value (possibly {@code null}).
104     *
105     * @see #getEndValue(int, int, int)
106     */
107    Number getStartValue(int row, int column, int subinterval);
108
109    /**
110     * Returns the start value of a sub-interval for a given item.
111     *
112     * @param rowKey  the row key.
113     * @param columnKey  the column key.
114     * @param subinterval  the sub-interval.
115     *
116     * @return The start value (possibly {@code null}).
117     *
118     * @see #getEndValue(Comparable, Comparable, int)
119     */
120    Number getStartValue(R rowKey, C columnKey, int subinterval);
121
122    /**
123     * Returns the end value of a sub-interval for a given item.
124     *
125     * @param row  the row index (zero-based).
126     * @param column  the column index (zero-based).
127     * @param subinterval  the sub-interval.
128     *
129     * @return The end value (possibly {@code null}).
130     *
131     * @see #getStartValue(int, int, int)
132     */
133    Number getEndValue(int row, int column, int subinterval);
134
135    /**
136     * Returns the end value of a sub-interval for a given item.
137     *
138     * @param rowKey  the row key.
139     * @param columnKey  the column key.
140     * @param subinterval  the sub-interval.
141     *
142     * @return The end value (possibly {@code null}).
143     *
144     * @see #getStartValue(Comparable, Comparable, int)
145     */
146    Number getEndValue(R rowKey, C columnKey, int subinterval);
147
148    /**
149     * Returns the percentage complete value of a sub-interval for a given item.
150     *
151     * @param row  the row index (zero-based).
152     * @param column  the column index (zero-based).
153     * @param subinterval  the sub-interval.
154     *
155     * @return The percent complete value (possibly {@code null}).
156     *
157     * @see #getPercentComplete(Comparable, Comparable, int)
158     */
159    Number getPercentComplete(int row, int column, int subinterval);
160
161    /**
162     * Returns the percentage complete value of a sub-interval for a given item.
163     *
164     * @param rowKey  the row key.
165     * @param columnKey  the column key.
166     * @param subinterval  the sub-interval.
167     *
168     * @return The percent complete value (possibly {@code null}).
169     *
170     * @see #getPercentComplete(int, int, int)
171     */
172    Number getPercentComplete(R rowKey, C columnKey, int subinterval);
173
174}