类 TimeTableData


  • public class TimeTableData
    extends TableData
    作者:
    wyq
    • 构造器详细资料

      • TimeTableData

        public TimeTableData()
        Constructor
      • TimeTableData

        public TimeTableData​(DataTable dataTable,
                             java.lang.String timeColName)
        Constructor
        参数:
        dataTable - Data table
        timeColName - Time column name
    • 方法详细资料

      • getTimeColName

        public java.lang.String getTimeColName()
        Get time column name
        覆盖:
        getTimeColName 在类中 TableData
        返回:
        Time column name
      • setTimeColName

        public void setTimeColName​(java.lang.String value)
        Set time column name
        参数:
        value - Time column name
      • readASCIIFile

        public void readASCIIFile​(java.lang.String fileName,
                                  int timeColIdx,
                                  java.lang.String formatStr,
                                  java.util.List<DataColumn> dataColumns)
                           throws java.io.FileNotFoundException,
                                  java.io.IOException,
                                  java.lang.Exception
        Read data table from ASCII file
        参数:
        fileName - File name
        timeColIdx - Time column index
        formatStr - Time format string
        dataColumns - Data columns
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
        java.lang.Exception
      • readASCIIFile

        public void readASCIIFile​(java.lang.String fileName,
                                  int timeColIdx,
                                  java.lang.String formatStr)
                           throws java.io.FileNotFoundException,
                                  java.io.IOException,
                                  java.lang.Exception
        Read data table from ASCII file
        参数:
        fileName - File name
        timeColIdx - Time column index
        formatStr - Time format string
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
        java.lang.Exception
      • getTimeIndex_Ex

        public int getTimeIndex_Ex​(java.util.Date t)
        Get time index
        参数:
        t - Time
        返回:
        Index
      • getTimeIndex

        public int getTimeIndex​(java.util.Date t)
        Get time index
        参数:
        t - Time
        返回:
        Index
      • getTimeIndex

        public java.util.List<java.lang.Integer> getTimeIndex​(java.util.List<java.util.Date> ts)
        Get time index list
        参数:
        ts - Times
        返回:
        Index list
      • getTimeIndex

        public java.util.List<java.lang.Integer> getTimeIndex​(java.util.Date st,
                                                              java.util.Date et,
                                                              int step)
        Get time index
        参数:
        st - Start time
        et - End time
        step - Step
        返回:
        Time index
      • getYears

        public java.util.List<java.lang.Integer> getYears()
        Get years
        返回:
        Year list
      • getYearMonths

        public java.util.List<java.lang.String> getYearMonths()
        Get year months
        返回:
        Year month list
      • getDates_Day

        public java.util.List<java.util.Date> getDates_Day()
        Get days
        返回:
        Date list
      • getDates_Hour

        public java.util.List<java.util.Date> getDates_Hour()
        Get date hours
        返回:
        Date list
      • getDataByYear

        public java.util.List<DataRow> getDataByYear​(int year)
        Get data row list by year
        参数:
        year - The year
        返回:
        Data row list
      • getDataBySeason

        public java.util.List<DataRow> getDataBySeason​(java.lang.String season)
        Get data row list by year
        参数:
        season - The season
        返回:
        Data row list
      • getDataByYearMonth

        public java.util.List<DataRow> getDataByYearMonth​(java.lang.String yearMonth)
        Get data row list by year and month
        参数:
        yearMonth - The year and month
        返回:
        Data row list
      • getDataByYearMonth

        public java.util.List<DataRow> getDataByYearMonth​(int year,
                                                          int month)
        Get data row list by year and month
        参数:
        year - The year
        month - The month
        返回:
        Data row list
      • getDataByDate

        public java.util.List<DataRow> getDataByDate​(java.util.Date date,
                                                     java.util.List<DataRow> drs)
        Get data row list by date
        参数:
        date - Date string
        drs - Data rows
        返回:
        Data row list
      • getDataByDate_Hour

        public java.util.List<DataRow> getDataByDate_Hour​(java.util.Date date,
                                                          java.util.List<DataRow> drs)
        Get data row list by date - hour
        参数:
        date - Date string
        drs - Data rows
        返回:
        Data row list
      • getDataByDate

        public java.util.List<DataRow> getDataByDate​(int year,
                                                     int month,
                                                     int day)
        Get data row list by date
        参数:
        year - The year
        month - The month
        day - The day
        返回:
        Data row list
      • getDataByDate

        public java.util.List<DataRow> getDataByDate​(int year,
                                                     int month,
                                                     int day,
                                                     int hour)
        Get data row list by date
        参数:
        year - The year
        month - The month
        day - The day
        hour - The hour
        返回:
        Data row list
      • getDataByMonth

        public java.util.List<DataRow> getDataByMonth​(int month)
        Get data row list by month
        参数:
        month - The month
        返回:
        Data row list
      • getDataByDayOfWeek

        public java.util.List<DataRow> getDataByDayOfWeek​(int dow)
        Get data row list by day of week
        参数:
        dow - Day of week
        返回:
        Data row list
      • getDataByHour

        public java.util.List<DataRow> getDataByHour​(int hour)
        Get data row list by hour
        参数:
        hour - The hour
        返回:
        Result data row list
      • ave_Year

        public DataTable ave_Year​(java.util.List<DataColumn> cols)
                           throws java.lang.Exception
        Average year by year
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_Year

        public DataTable ave_Year​(java.util.List<DataColumn> cols,
                                  int year)
                           throws java.lang.Exception
        Average year
        参数:
        cols - The data columns
        year - The year
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_Year

        public DataTable sum_Year​(java.util.List<DataColumn> cols)
                           throws java.lang.Exception
        Average year by year
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_YearMonth

        public DataTable ave_YearMonth​(java.util.List<DataColumn> cols,
                                       int month)
                                throws java.lang.Exception
        Average month by year
        参数:
        cols - The data columns
        month - The month
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_YearMonth

        public DataTable sum_YearMonth​(java.util.List<DataColumn> cols,
                                       int month)
                                throws java.lang.Exception
        Sum month by year
        参数:
        cols - The data columns
        month - The month
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_Month

        public DataTable ave_Month​(java.util.List<DataColumn> cols)
                            throws java.lang.Exception
        Average month by month
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_Month

        public DataTable sum_Month​(java.util.List<DataColumn> cols)
                            throws java.lang.Exception
        Summary month by month
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_Day

        public DataTable ave_Day​(java.util.List<DataColumn> cols)
                          throws java.lang.Exception
        Average daily
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_Day

        public DataTable sum_Day​(java.util.List<DataColumn> cols)
                          throws java.lang.Exception
        Summary daily
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_Hour

        public DataTable ave_Hour​(java.util.List<DataColumn> cols)
                           throws java.lang.Exception
        Average Hourly
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_Hour

        public DataTable sum_Hour​(java.util.List<DataColumn> cols)
                           throws java.lang.Exception
        Summary Hourly
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_MonthOfYear

        public DataTable ave_MonthOfYear​(java.util.List<DataColumn> cols)
                                  throws java.lang.Exception
        Average monthly
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_MonthOfYear

        public DataTable sum_MonthOfYear​(java.util.List<DataColumn> cols)
                                  throws java.lang.Exception
        Summary month of year
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_SeasonOfYear

        public DataTable ave_SeasonOfYear​(java.util.List<DataColumn> cols)
                                   throws java.lang.Exception
        Average seasonal
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_SeasonOfYear

        public DataTable sum_SeasonOfYear​(java.util.List<DataColumn> cols)
                                   throws java.lang.Exception
        Summary seasonal
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_DayOfWeek

        public DataTable ave_DayOfWeek​(java.util.List<DataColumn> cols)
                                throws java.lang.Exception
        Average by day of week
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_DayOfWeek

        public DataTable sum_DayOfWeek​(java.util.List<DataColumn> cols)
                                throws java.lang.Exception
        Summary by day of week
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • ave_HourOfDay

        public DataTable ave_HourOfDay​(java.util.List<DataColumn> cols)
                                throws java.lang.Exception
        Average by hour of day
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • sum_HourOfDay

        public DataTable sum_HourOfDay​(java.util.List<DataColumn> cols)
                                throws java.lang.Exception
        Summary by hour of day
        参数:
        cols - The data columns
        返回:
        Result data table
        抛出:
        java.lang.Exception
      • getDateList

        public static java.util.List<java.util.Date> getDateList​(java.util.Date stdate,
                                                                 java.util.Date enddate,
                                                                 java.lang.String tdtype,
                                                                 int timeDelt)
                                                          throws java.io.FileNotFoundException,
                                                                 java.io.IOException,
                                                                 java.text.ParseException
        Get date list - String
        参数:
        stdate - Start date
        enddate - End date
        tdtype - Calendar type
        timeDelt - Time delta value
        返回:
        Date list
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
        java.text.ParseException
      • timeOrder

        public TimeTableData timeOrder​(java.util.Date stdate,
                                       java.util.Date enddate,
                                       java.lang.String tdtype,
                                       int timeDelt)
                                throws java.io.IOException,
                                       java.io.FileNotFoundException,
                                       java.text.ParseException,
                                       java.lang.Exception
        Time order for data
        参数:
        stdate - Start date
        enddate - End date
        tdtype - Calendar type
        timeDelt - Time delta
        返回:
        Ordered data
        抛出:
        java.io.IOException
        java.io.FileNotFoundException
        java.text.ParseException
        java.lang.Exception