类 TableUtil


  • public class TableUtil
    extends java.lang.Object
    作者:
    yaqiang
    • 构造器概要

      构造器 
      构造器 说明
      TableUtil()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      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)
      Average month by month
      static java.lang.String getDateFormat​(java.lang.String dt)
      Get date format string
      static java.util.List<java.lang.String> getFormats​(java.lang.String formatSpec)
      Get format list
      static java.util.List<java.lang.String> getYearMonths​(java.util.List<java.util.Date> time)
      Get year months
      static TableData readASCIIFile​(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 file
      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)
      Read data table from ASCII file
      static DataTypes toDataTypes​(java.lang.String dt)
      To data type - MeteoInfo
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • TableUtil

        public TableUtil()
    • 方法详细资料

      • 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 name
        delimiter - Delimiter
        headerLines - Number of lines to skip at begining of the file
        formatSpec - Format specifiers string
        encoding - Fle encoding
        readVarNames - Read variable names or not
        返回:
        TableData object
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
        java.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 name
        delimiter - Delimiter
        headerLines - Number of lines to skip at begining of the file
        formatSpec - Format specifiers string
        encoding - Fle encoding
        readVarNames - Read variable names or not
        usecolsin - Filter columns by column names or indices
        返回:
        TableData object
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
        java.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 list
        colNames - Column names
        time - 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