Interface Dataset
- All Superinterfaces:
- Serializable
- All Known Subinterfaces:
- NonSerializableDataset
- All Known Implementing Classes:
- AbstractDataset,- ArrayDataset,- BasicDataset,- BasicStreamingDataset,- CacheAggregateDataset,- ColumnAttributesDataSet,- ColumnFilteredDataSet,- DatasetUtilities.PyDataSet,- JsonDataset,- MutableDataset,- NonSerializingDataset,- OptimizedDataSet,- RowFilteredDataSet,- StreamingDataset,- TimeMaskedDataset
A Dataset represents tabular data. It is a collection of zero or more rows, each of which have the same column
 structure. A column has a defined name and datatype. Datasets are typically immutable.
- 
Method SummaryModifier and TypeMethodDescriptiondefault intbinarySearch(int column, Object key) Performs a binary search on the specified column, looking for the specified key.getColumnAsList(int col) intReturns the number of columns.intgetColumnIndex(String name) Returns the index of the given column, case-insensitivegetColumnName(int col) Returns the name of the given column.Returns an unmodifiable list of this dataset's column names, in order.Class<?>getColumnType(int col) Returns the type of the given column.Returns an unmodifiable list of this dataset's column types, in order.doublegetPrimitiveValueAt(int row, int col) If the given column is a numeric type or a Date, then the value will be returned as a double.getQualityAt(int row, int col) Returns the quality of the value at the given location.intReturn the number of rows in this datasetgetValueAt(int row, int col) Returns the value in the dataset at the given location.getValueAt(int row, String colName) Returns the value at the given row and at a column named colName.default booleanWhether this dataset has any quality data to report.
- 
Method Details- 
getColumnNamesReturns an unmodifiable list of this dataset's column names, in order.
- 
getColumnTypesReturns an unmodifiable list of this dataset's column types, in order.
- 
getColumnCountint getColumnCount()Returns the number of columns.
- 
getRowCountint getRowCount()Return the number of rows in this dataset
- 
getColumnAsList
- 
getColumnIndexReturns the index of the given column, case-insensitive- Parameters:
- name- the name of the column to look up
- Returns:
- the index of the column
- Throws:
- ArrayIndexOutOfBoundsException- if the column isn't found.
 
- 
getColumnNameReturns the name of the given column.- Throws:
- IndexOutOfBoundsException- if the given index is out of range.
 
- 
getColumnTypeReturns the type of the given column.- Throws:
- IndexOutOfBoundsException- if the given index is out of range.
 
- 
getValueAtReturns the value in the dataset at the given location.- Throws:
- ArrayIndexOutOfBoundsException- if the given row, col is out of range.
 
- 
getQualityAtReturns the quality of the value at the given location.- Throws:
- ArrayIndexOutOfBoundsException- if the given row, col is out of range and- hasQualityData()returns true.
 
- 
getValueAtReturns the value at the given row and at a column named colName. Column name matching is case insensitive.- Throws:
- ArrayIndexOutOfBoundsException- if the column isn't found.
 
- 
getPrimitiveValueAtdouble getPrimitiveValueAt(int row, int col) If the given column is a numeric type or a Date, then the value will be returned as a double. (Charts uses this functionality to provide a seamless interface with certain optimized dataset implementations.- Throws:
- IllegalArgumentException- if the value at row, col is not a number or date.
- UnsupportedOperationException- if the Dataset implementation declines to implement this operation.
 
- 
binarySearchPerforms a binary search on the specified column, looking for the specified key. Column MUST be sorted in ascending order. Dataset provides an inefficient default implementation of binary search that allocates a new array list for the entire column.- Returns:
- index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the list: the index of the first element greater than the key, or list.size(), if all elements in the list are less than the specified key. Note that this guarantees the return value will be greater than or equal to 0, but only if the key is found.
- Throws:
- ClassCastException- if the given type is not- Comparable.
- UnsupportedOperationException- if the Dataset implementation declines to implement this operation.
 
- 
hasQualityDatadefault boolean hasQualityData()Whether this dataset has any quality data to report. If false, getQualityAt is expected to returnQualityCode.Good.- See Also:
 
 
-