类 TableUtil
- java.lang.Object
-
- org.meteoinfo.data.TableUtil
-
public class TableUtil extends java.lang.Object- 作者:
- yaqiang
-
-
构造器概要
构造器 构造器 说明 TableUtil()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static DataTableave_Month(java.util.List<ucar.ma2.Array> data, java.util.List<java.lang.String> colNames, java.util.List<java.util.Date> time)Average month by monthstatic java.lang.StringgetDateFormat(java.lang.String dt)Get date format stringstatic java.util.List<java.lang.String>getFormats(java.lang.String formatSpec)Get format liststatic java.util.List<java.lang.String>getYearMonths(java.util.List<java.util.Date> time)Get year monthsstatic TableDatareadASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String formatSpec, java.lang.String encoding, boolean readVarNames)Read data table from ASCII filestatic TableDatareadASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String formatSpec, java.lang.String encoding, boolean readVarNames, java.util.List<java.lang.Object> usecolsin)Read data table from ASCII filestatic DataTypestoDataTypes(java.lang.String dt)To data type - MeteoInfo
-
-
-
方法详细资料
-
readASCIIFile
public static TableData readASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String formatSpec, java.lang.String encoding, boolean readVarNames) throws java.io.FileNotFoundException, java.io.IOException, java.lang.Exception
Read data table from ASCII file- 参数:
fileName- File namedelimiter- DelimiterheaderLines- Number of lines to skip at begining of the fileformatSpec- Format specifiers stringencoding- Fle encodingreadVarNames- Read variable names or not- 返回:
- TableData object
- 抛出:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
readASCIIFile
public static TableData readASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String formatSpec, java.lang.String encoding, boolean readVarNames, java.util.List<java.lang.Object> usecolsin) throws java.io.FileNotFoundException, java.io.IOException, java.lang.Exception
Read data table from ASCII file- 参数:
fileName- File namedelimiter- DelimiterheaderLines- Number of lines to skip at begining of the fileformatSpec- Format specifiers stringencoding- Fle encodingreadVarNames- Read variable names or notusecolsin- Filter columns by column names or indices- 返回:
- TableData object
- 抛出:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
getFormats
public static java.util.List<java.lang.String> getFormats(java.lang.String formatSpec)
Get format list- 参数:
formatSpec- Input format specific string- 返回:
- Format list
-
toDataTypes
public static DataTypes toDataTypes(java.lang.String dt)
To data type - MeteoInfo- 参数:
dt- Data type string- 返回:
- Data type
-
getDateFormat
public static java.lang.String getDateFormat(java.lang.String dt)
Get date format string- 参数:
dt- Format string- 返回:
- Date format string
-
ave_Month
public static DataTable ave_Month(java.util.List<ucar.ma2.Array> data, java.util.List<java.lang.String> colNames, java.util.List<java.util.Date> time) throws java.lang.Exception
Average month by month- 参数:
data- Data array listcolNames- Column namestime- Time list- 返回:
- Result data table
- 抛出:
java.lang.Exception
-
getYearMonths
public static java.util.List<java.lang.String> getYearMonths(java.util.List<java.util.Date> time)
Get year months- 参数:
time- Date list- 返回:
- Year month list
-
-