Package hec.data

Class Interval

All Implemented Interfaces:
Serializable

@Deprecated public class Interval extends AbstractDataSet implements Serializable
Deprecated.
As of 02/08/2021 use Interval or one of the implementations of mil.army.usace.hec.metadata.Interval in hec-nucleus-metadata.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Deprecated.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
    • getInterval

      public String getInterval()
      Deprecated.
    • setInterval

      public void setInterval(String intervalName) throws DataSetIllegalArgumentException
      Deprecated.
      Throws:
      DataSetIllegalArgumentException
    • setInterval

      public void setInterval(int minutes) throws DataSetIllegalArgumentException
      Deprecated.
      Throws:
      DataSetIllegalArgumentException
    • getAvailableIntervals

      public static String[] getAvailableIntervals()
      Deprecated.
    • getSeconds

      public int getSeconds()
      Deprecated.
    • getTimeAtTopOfIntervalOnOrBefore

      @Deprecated public static long getTimeAtTopOfIntervalOnOrBefore(long time, String intervalName, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      This method is inefficient as it has to construct the interval. Use getTimeOnPreviousInterval(long, Interval, IntervalOffset, TimeZone) instead.
      Parameters:
      time -
      intervalName -
      timeZone -
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • getTimeOnPreviousInterval

      public static long getTimeOnPreviousInterval(long time, Interval interval, IntervalOffset intervalOffset, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      Determines the previous interval time using the arg time. The previous interval time will be at the top of the interval if the offset arg is null. If the offset arg is not null, then the next interval time will be at the top of the interval + the offset.
      Parameters:
      time -
      interval -
      intervalOffset -
      timeZone -
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • getTimeAtTopOfIntervalOnOrAfter

      @Deprecated public static long getTimeAtTopOfIntervalOnOrAfter(long time, String intervalName, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      This method is inefficient as it has to construct the interval. Use getTimeOnNextInterval(long, Interval, IntervalOffset, TimeZone) instead.
      Parameters:
      time -
      intervalName -
      timeZone -
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • getTimeOnNextInterval

      public static long getTimeOnNextInterval(long time, Interval interval, IntervalOffset intervalOffset, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      Determines the next interval time using the arg time. The next interval time will be at the top of the interval if the offset arg is null. If the offset arg is not null, then the next interval time will be at the top of the interval + the offset.
      Parameters:
      time -
      interval -
      intervalOffset -
      timeZone -
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • isLessThanDecade

      public boolean isLessThanDecade()
      Deprecated.
    • isLessThanYearly

      public boolean isLessThanYearly()
      Deprecated.
    • isLessThanMonthly

      public boolean isLessThanMonthly()
      Deprecated.
    • isLessThanWeekly

      public boolean isLessThanWeekly()
      Deprecated.
    • isLessThanDaily

      public boolean isLessThanDaily()
      Deprecated.
    • isLessThanHourly

      public boolean isLessThanHourly()
      Deprecated.
    • getTimeAtNextInterval

      @Deprecated public static long getTimeAtNextInterval(long time, String intervalName, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      This method is inefficient as it has to construct the interval. Use the getNextIntervalTime(long, Interval, TimeZone) method instead.
      Parameters:
      time -
      intervalName -
      timeZone -
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • getNextIntervalTime

      public static long getNextIntervalTime(long time, Interval interval, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      Takes the arg time, adds one interval, and returns the value. Does not account for top of interval or time offsets.
      Parameters:
      time -
      interval -
      timeZone -
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • getPreviousIntervalTime

      public static long getPreviousIntervalTime(long time, Interval interval, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      Takes the arg time, subtracts one interval, and returns the time. Does not account for top of interval or time offsets.
      Parameters:
      time -
      interval -
      timeZone -
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • calcNumberOfIntervals

      public static long calcNumberOfIntervals(Date startTime, Date endTime, Interval interval, IntervalOffset intervalOffset, TimeZone timeZone) throws DataSetIllegalArgumentException
      Deprecated.
      Returns the number of intervals contained between the start and end times for the offsetted interval.
      Parameters:
      startTime - top of interval is on or after this time
      endTime - top of interval is on or before this time
      interval - the interval
      intervalOffset - the offset for the interval
      timeZone - the time zone for calendar math
      Returns:
      Throws:
      DataSetIllegalArgumentException
    • getMillis

      public long getMillis()
      Deprecated.
    • getMinutes

      public int getMinutes()
      Deprecated.
    • isRegular

      public boolean isRegular()
      Deprecated.
      Return true means MUST cross a Day, Month, and Year EXACTLY
    • isNotRegular

      public boolean isNotRegular()
      Deprecated.
    • isHourly

      public boolean isHourly()
      Deprecated.
    • isDaily

      public boolean isDaily()
      Deprecated.
    • isWeekly

      public boolean isWeekly()
      Deprecated.
    • isMonthly

      public boolean isMonthly()
      Deprecated.
    • isYearly

      public boolean isYearly()
      Deprecated.
    • parseForInterval

      public static int parseForInterval(String intervalName) throws DataSetIllegalArgumentException
      Deprecated.
      Throws:
      DataSetIllegalArgumentException
    • parseIntervalName

      protected void parseIntervalName(String intervalName) throws DataSetIllegalArgumentException
      Deprecated.
      Throws:
      DataSetIllegalArgumentException
    • isRegular

      public static boolean isRegular(int intervalMinutes)
      Deprecated.
      Returns a boolean indicating if the argument intervalMinutes is a valid regular time series.
    • getCalendarField

      public int getCalendarField()
      Deprecated.
      Returns the appropriate Calendar field for this interval.
      Returns:
    • getCalendarAmount

      public int getCalendarAmount()
      Deprecated.
      Returns the corresponding amount value to be used with the calendar field from this interval
      Returns:
    • getMetaDataInterval

      public mil.army.usace.hec.metadata.Interval getMetaDataInterval()
      Deprecated.