类 TableData
- java.lang.Object
-
- org.meteoinfo.table.DataTable
-
- org.meteoinfo.data.TableData
-
- 直接已知子类:
StationTableData,TimeTableData
public class TableData extends org.meteoinfo.table.DataTable- 作者:
- Yaqiang Wang
-
-
字段概要
字段 修饰符和类型 字段 说明 protected doublemissingValue
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddColumnData(int index, java.lang.String colName, java.lang.String dt, java.util.List<java.lang.Object> colData)Add column datavoidaddColumnData(java.lang.String colName, java.lang.String dt, java.util.List<java.lang.Object> colData)Add column dataorg.meteoinfo.table.DataTableave_DayOfWeek(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName)Average by day of weekorg.meteoinfo.table.DataTableave_HourOfDay(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName)Average by hour of dayorg.meteoinfo.table.DataTableave_Month(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName)Average month by monthorg.meteoinfo.table.DataTableave_MonthOfYear(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName)Average monthlyorg.meteoinfo.table.DataTableave_SeasonOfYear(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName)Average seasonalorg.meteoinfo.table.DataTableave_stdev(java.util.List<org.meteoinfo.table.DataColumn> cols)Average data and calculate standard deviationorg.meteoinfo.table.DataTableave_Year(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName)Average year by yearorg.meteoinfo.table.DataTableaverage(java.util.List<org.meteoinfo.table.DataColumn> cols)Average datajava.lang.Objectclone()ClonevoidcolumnToDouble(java.lang.String colName)Convert a data column to double data typejava.util.List<org.meteoinfo.table.DataRow>getDataByDayOfWeek(int dow, java.lang.String tColName)Get data row list by day of weekjava.util.List<org.meteoinfo.table.DataRow>getDataByHour(int hour, java.lang.String tColName)Get data row list by hourjava.util.List<org.meteoinfo.table.DataRow>getDataByMonth(int month, java.lang.String tColName)Get data row list by monthjava.util.List<org.meteoinfo.table.DataRow>getDataBySeason(java.lang.String season, java.lang.String tColName)Get data row list by yearjava.util.List<org.meteoinfo.table.DataRow>getDataByYear(int year, java.lang.String tColName)Get data row list by yearjava.util.List<org.meteoinfo.table.DataRow>getDataByYearMonth(int year, int month, java.lang.String tColName)Get data row list by year and monthjava.util.List<org.meteoinfo.table.DataRow>getDataByYearMonth(java.lang.String yearMonth, java.lang.String tColName)Get data row list by year and monthjava.util.List<org.meteoinfo.table.DataColumn>getDataColumns()Get data columnsdoublegetMissingValue()Get missing valueorg.meteoinfo.table.DataRowgetRow(int idx)Get data rowjava.lang.StringgetTimeColName()Get time column namejava.util.List<java.lang.Double>getValidColumnValues(java.util.List<org.meteoinfo.table.DataRow> rows, org.meteoinfo.table.DataColumn col)Get column valuesjava.util.List<java.lang.Double>getValidColumnValues(org.meteoinfo.table.DataColumn col)Get column valuesjava.util.List<java.lang.String>getYearMonths(java.lang.String tColName)Get year monthsjava.util.List<java.lang.Integer>getYears(java.lang.String tColName)Get yearsvoidjoin(TableData tableData, java.lang.String colName)Join data tablevoidjoin(TableData tableData, java.lang.String thisColName, java.lang.String otherColName)Join data tablevoidreadASCIIFile(java.lang.String fileName)Read data table from ASCII filevoidreadASCIIFile(java.lang.String fileName, java.lang.String formatSpec)Read data table from ASCII filevoidreadASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String formatSpec, java.lang.String encoding)Read data table from ASCII filevoidreadASCIIFile(java.lang.String fileName, java.util.List<org.meteoinfo.table.DataColumn> dataColumns)Read data table from ASCII filevoidremoveColumn(java.lang.String colName)Remove a columnvoidsetColumnData(java.lang.String colName, java.util.List<java.lang.Object> values)Set column datavoidsetMissingValue(double value)Set missing valueTableDatasqlSelect(java.lang.String expression)SQL selectorg.meteoinfo.table.DataTablestatistics()Get average data tableorg.meteoinfo.table.DataTablestatistics(java.util.List<org.meteoinfo.table.DataColumn> dataColumns)Get average data tableorg.meteoinfo.table.DataTablesum(java.util.List<org.meteoinfo.table.DataColumn> cols)Summary dataorg.meteoinfo.table.DataTabletoSingleRowTable()Convert a multi rows data table to single row data tableorg.meteoinfo.table.DataTabletoSingleRowTable(org.meteoinfo.table.DataTable inTable)Convert a multi rows data table to single row data tableorg.meteoinfo.table.DataTabletoSingleRowTable(org.meteoinfo.table.DataTable inTable, java.lang.String firstColName, java.lang.String firstColValue)Convert a multi rows data table to single row data table-
从类继承的方法 org.meteoinfo.table.DataTable
addColumn, addColumn, addColumn, addColumn, addColumnData, addColumnData, addColumnData, addRow, addRow, addRows, appendRow, avg, avg, cloneTable_Field, colSelect, findColumn, findColumns, findColumns_Index, getColumnCount, getColumnData, getColumnData, getColumnData, getColumnNames, getColumns, getRowCount, getRows, getRows, getRows, getTableName, getTag, getTotalCount, getValue, getValue, hasTimeColumn, head, isReadOnly, join, join, join, max, max, min, min, newRow, removeColumn, removeJoin, removeRow, removeRow, removeRows, renameColumn, renameColumn, renameColumn, saveAsASCIIFile, saveAsASCIIFile, saveAsASCIIFile_format, saveAsCSVFile, saveAsCSVFile, select, select, select, select, select, select, select, select, select, select, select, select, setColumnData, setReadOnly, setRows, setTableName, setTag, setValue, setValue, setValues, tail, toString, toString, toString, toString
-
-
-
-
方法详细资料
-
getTimeColName
public java.lang.String getTimeColName()
Get time column name- 返回:
- Time column name
-
getMissingValue
public double getMissingValue()
Get missing value- 返回:
- Missing value
-
setMissingValue
public void setMissingValue(double value)
Set missing value- 参数:
value- Missing value
-
addColumnData
public void addColumnData(java.lang.String colName, java.lang.String dt, java.util.List<java.lang.Object> colData) throws java.lang.ExceptionAdd column data- 覆盖:
addColumnData在类中org.meteoinfo.table.DataTable- 参数:
colName- Column namedt- Data type stringcolData- The column data- 抛出:
java.lang.Exception
-
addColumnData
public void addColumnData(int index, java.lang.String colName, java.lang.String dt, java.util.List<java.lang.Object> colData) throws java.lang.ExceptionAdd column data- 参数:
index- Column indexcolName- Column namedt- Data type stringcolData- The column data- 抛出:
java.lang.Exception
-
removeColumn
public void removeColumn(java.lang.String colName)
Remove a column- 参数:
colName- Column name
-
getRow
public org.meteoinfo.table.DataRow getRow(int idx)
Get data row- 参数:
idx- Index- 返回:
- Data row
-
getDataColumns
public java.util.List<org.meteoinfo.table.DataColumn> getDataColumns()
Get data columns- 返回:
- Data columns
-
getValidColumnValues
public java.util.List<java.lang.Double> getValidColumnValues(org.meteoinfo.table.DataColumn col)
Get column values- 参数:
col- The data column- 返回:
- Value list
-
getValidColumnValues
public java.util.List<java.lang.Double> getValidColumnValues(java.util.List<org.meteoinfo.table.DataRow> rows, org.meteoinfo.table.DataColumn col)Get column values- 参数:
rows- The data row listcol- The data column- 返回:
- Column values
-
setColumnData
public void setColumnData(java.lang.String colName, java.util.List<java.lang.Object> values)Set column data- 覆盖:
setColumnData在类中org.meteoinfo.table.DataTable- 参数:
colName- Column namevalues- Values
-
columnToDouble
public void columnToDouble(java.lang.String colName)
Convert a data column to double data type- 参数:
colName- The data column name
-
average
public org.meteoinfo.table.DataTable average(java.util.List<org.meteoinfo.table.DataColumn> cols) throws java.lang.ExceptionAverage data- 参数:
cols- The data columns- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
sum
public org.meteoinfo.table.DataTable sum(java.util.List<org.meteoinfo.table.DataColumn> cols) throws java.lang.ExceptionSummary data- 参数:
cols- The data columns- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
ave_stdev
public org.meteoinfo.table.DataTable ave_stdev(java.util.List<org.meteoinfo.table.DataColumn> cols) throws java.lang.ExceptionAverage data and calculate standard deviation- 参数:
cols- The data columns- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
statistics
public org.meteoinfo.table.DataTable statistics(java.util.List<org.meteoinfo.table.DataColumn> dataColumns) throws java.lang.ExceptionGet average data table- 参数:
dataColumns-- 返回:
- Average data table
- 抛出:
java.lang.Exception
-
statistics
public org.meteoinfo.table.DataTable statistics() throws java.lang.ExceptionGet average data table- 返回:
- Average data table
- 抛出:
java.lang.Exception
-
readASCIIFile
public void readASCIIFile(java.lang.String fileName, java.lang.String formatSpec) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionRead data table from ASCII file- 参数:
fileName- File nameformatSpec- Format specifiers string- 抛出:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
readASCIIFile
public void readASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String formatSpec, java.lang.String encoding) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionRead data table from ASCII file- 参数:
fileName- File namedelimiter- DelimiterheaderLines- Number of lines to skip at begining of the fileformatSpec- Format specifiers stringencoding- Fle encoding- 抛出:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
readASCIIFile
public void readASCIIFile(java.lang.String fileName, java.util.List<org.meteoinfo.table.DataColumn> dataColumns) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionRead data table from ASCII file- 参数:
fileName- File namedataColumns- Data columns- 抛出:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
readASCIIFile
public void readASCIIFile(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionRead data table from ASCII file- 参数:
fileName- File name- 抛出:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
toSingleRowTable
public org.meteoinfo.table.DataTable toSingleRowTable(org.meteoinfo.table.DataTable inTable, java.lang.String firstColName, java.lang.String firstColValue) throws java.lang.ExceptionConvert a multi rows data table to single row data table- 参数:
inTable- Input data table - multi rowsfirstColName- The new first column namefirstColValue- The new first column value- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
toSingleRowTable
public org.meteoinfo.table.DataTable toSingleRowTable(org.meteoinfo.table.DataTable inTable) throws java.lang.ExceptionConvert a multi rows data table to single row data table- 参数:
inTable- Input data table - multi rows- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
toSingleRowTable
public org.meteoinfo.table.DataTable toSingleRowTable() throws java.lang.ExceptionConvert a multi rows data table to single row data table- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
join
public void join(TableData tableData, java.lang.String colName)
Join data table- 参数:
tableData- The input table datacolName- The column name for join
-
join
public void join(TableData tableData, java.lang.String thisColName, java.lang.String otherColName)
Join data table- 参数:
tableData- The input table datathisColName- The column name for joinotherColName- The other column name for join
-
clone
public java.lang.Object clone()
Clone- 覆盖:
clone在类中org.meteoinfo.table.DataTable- 返回:
- Cloned TableData object
-
getYears
public java.util.List<java.lang.Integer> getYears(java.lang.String tColName)
Get years- 参数:
tColName- Time column name- 返回:
- Year list
-
getYearMonths
public java.util.List<java.lang.String> getYearMonths(java.lang.String tColName)
Get year months- 参数:
tColName- Time column name- 返回:
- Year month list
-
getDataByYear
public java.util.List<org.meteoinfo.table.DataRow> getDataByYear(int year, java.lang.String tColName)Get data row list by year- 参数:
year- The yeartColName- Time column name- 返回:
- Data row list
-
getDataBySeason
public java.util.List<org.meteoinfo.table.DataRow> getDataBySeason(java.lang.String season, java.lang.String tColName)Get data row list by year- 参数:
season- The seasontColName- Time column name- 返回:
- Data row list
-
getDataByYearMonth
public java.util.List<org.meteoinfo.table.DataRow> getDataByYearMonth(java.lang.String yearMonth, java.lang.String tColName)Get data row list by year and month- 参数:
yearMonth- The year and monthtColName- Time column name- 返回:
- Data row list
-
getDataByYearMonth
public java.util.List<org.meteoinfo.table.DataRow> getDataByYearMonth(int year, int month, java.lang.String tColName)Get data row list by year and month- 参数:
year- The yearmonth- The monthtColName- Time column name- 返回:
- Data row list
-
getDataByMonth
public java.util.List<org.meteoinfo.table.DataRow> getDataByMonth(int month, java.lang.String tColName)Get data row list by month- 参数:
month- The monthtColName- Time column name- 返回:
- Data row list
-
getDataByDayOfWeek
public java.util.List<org.meteoinfo.table.DataRow> getDataByDayOfWeek(int dow, java.lang.String tColName)Get data row list by day of week- 参数:
dow- Day of weektColName- Time column name- 返回:
- Data row list
-
getDataByHour
public java.util.List<org.meteoinfo.table.DataRow> getDataByHour(int hour, java.lang.String tColName)Get data row list by hour- 参数:
hour- The hourtColName- Time column name- 返回:
- Result data row list
-
ave_Year
public org.meteoinfo.table.DataTable ave_Year(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName) throws java.lang.ExceptionAverage year by year- 参数:
cols- The data columnstColName- The time column name- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
ave_Month
public org.meteoinfo.table.DataTable ave_Month(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName) throws java.lang.ExceptionAverage month by month- 参数:
cols- The data columnstColName- Time column name- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
ave_MonthOfYear
public org.meteoinfo.table.DataTable ave_MonthOfYear(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName) throws java.lang.ExceptionAverage monthly- 参数:
cols- The data columnstColName- Time column name- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
ave_SeasonOfYear
public org.meteoinfo.table.DataTable ave_SeasonOfYear(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName) throws java.lang.ExceptionAverage seasonal- 参数:
cols- The data columnstColName- Time column name- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
ave_DayOfWeek
public org.meteoinfo.table.DataTable ave_DayOfWeek(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName) throws java.lang.ExceptionAverage by day of week- 参数:
cols- The data columnstColName- Time column name- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
ave_HourOfDay
public org.meteoinfo.table.DataTable ave_HourOfDay(java.util.List<org.meteoinfo.table.DataColumn> cols, java.lang.String tColName) throws java.lang.ExceptionAverage by hour of day- 参数:
cols- The data columnstColName- Time column name- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
sqlSelect
public TableData sqlSelect(java.lang.String expression)
SQL select- 覆盖:
sqlSelect在类中org.meteoinfo.table.DataTable- 参数:
expression- SQL expression- 返回:
- Result TableData
-
-