001/* =========================================================== 002 * Orson Charts : a 3D chart library for the Java(tm) platform 003 * =========================================================== 004 * 005 * (C)opyright 2013-2016, by Object Refinery Limited. All rights reserved. 006 * 007 * http://www.object-refinery.com/orsoncharts/index.html 008 * 009 * This program is free software: you can redistribute it and/or modify 010 * it under the terms of the GNU General Public License as published by 011 * the Free Software Foundation, either version 3 of the License, or 012 * (at your option) any later version. 013 * 014 * This program is distributed in the hope that it will be useful, 015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 017 * GNU General Public License for more details. 018 * 019 * You should have received a copy of the GNU General Public License 020 * along with this program. If not, see <http://www.gnu.org/licenses/>. 021 * 022 * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 023 * Other names may be trademarks of their respective owners.] 024 * 025 * If you do not wish to be bound by the terms of the GPL, an alternative 026 * commercial license can be purchased. For details, please see visit the 027 * Orson Charts home page: 028 * 029 * http://www.object-refinery.com/orsoncharts/index.html 030 * 031 */ 032 033package com.orsoncharts.data; 034 035import java.util.List; 036 037/** 038 * A three dimensional cube of data values where each value is uniquely 039 * identified by three keys (the {@code seriesKey}, {@code rowKey} 040 * and {@code columnKey}). 041 */ 042public interface KeyedValues3D<T> extends Values3D<T> { 043 044 /** 045 * Returns a list of the series keys for the dataset. Modifying this 046 * list will have no impact on the underlying dataset. 047 * 048 * @return A list of the series keys (possibly empty, but never 049 * {@code null}). 050 */ 051 List<Comparable<?>> getSeriesKeys(); 052 053 /** 054 * Returns a list of the row keys for the dataset. Modifying this 055 * list will have no impact on the underlying dataset. 056 * 057 * @return A list of the row keys (possibly empty, but never 058 * {@code null}). 059 */ 060 List<Comparable<?>> getRowKeys(); 061 062 /** 063 * Returns a list of the column keys for the dataset. Modifying this 064 * list will have no impact on the underlying dataset. 065 * 066 * @return A list of the column keys (possibly empty, but never 067 * {@code null}). 068 */ 069 List<Comparable<?>> getColumnKeys(); 070 071 /** 072 * Returns the series key with the specified index. 073 * 074 * @param seriesIndex the series index. 075 * 076 * @return The key. 077 */ 078 Comparable<?> getSeriesKey(int seriesIndex); 079 080 /** 081 * Returns the row key with the specified index. 082 * 083 * @param rowIndex the row index. 084 * 085 * @return The key. 086 */ 087 Comparable<?> getRowKey(int rowIndex); 088 089 /** 090 * Returns the column key with the specified index. 091 * 092 * @param columnIndex the column index. 093 * 094 * @return The key. 095 */ 096 Comparable<?> getColumnKey(int columnIndex); 097 098 /** 099 * Returns the index of the specified series key, or {@code -1} if 100 * there is no matching key. 101 * 102 * @param serieskey the series key ({@code null} not permitted). 103 * 104 * @return The key index, or {@code -1}. 105 */ 106 int getSeriesIndex(Comparable<?> serieskey); 107 108 /** 109 * Returns the index of the specified row key, or {@code -1} if there 110 * is no matching key. 111 * 112 * @param rowkey the row key ({@code null} not permitted). 113 * 114 * @return The row index or {@code -1}. 115 */ 116 int getRowIndex(Comparable<?> rowkey); 117 118 /** 119 * Returns the index of the specified column key, or {@code -1} if 120 * there is no matching key. 121 * 122 * @param columnkey the column key ({@code null} not permitted). 123 * 124 * @return The column index or {@code -1}. 125 */ 126 int getColumnIndex(Comparable<?> columnkey); 127 128 /** 129 * Returns the value for a given series, row and column. 130 * 131 * @param seriesKey the series key ({@code null} not permitted). 132 * @param rowKey the row key ({@code null} not permitted). 133 * @param columnKey the column key ({@code null} not permitted). 134 * 135 * @return The value (possibly {@code null}). 136 */ 137 T getValue(Comparable<?> seriesKey, Comparable<?> rowKey, 138 Comparable<?> columnKey); 139 140}