com.amazon.redshift.util

## Class RedshiftIntervalDayToSecond

- java.lang.Object
- - com.amazon.redshift.util.RedshiftObject
  - - com.amazon.redshift.util.RedshiftInterval
    - - com.amazon.redshift.util.RedshiftIntervalDayToSecond

All Implemented Interfaces:
  Serializable, Cloneable

    public class RedshiftIntervalDayToSecond
    extends RedshiftInterval
    implements Serializable, Cloneable

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class com.amazon.redshift.util.RedshiftObject

`type, value`

### Constructor Summary

Constructors
Constructor and Description
`RedshiftIntervalDayToSecond()` required by the driver.
`RedshiftIntervalDayToSecond(int days, int hours, int minutes, double seconds)`
`RedshiftIntervalDayToSecond(long time)`
`RedshiftIntervalDayToSecond(String value)` Initialize an interval with a given interval string representation.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(RedshiftIntervalDayToSecond interval)` Add this interval's value to the passed interval.
`boolean` `equals(Object obj)` Returns whether an object is equal to this one or not.
`String` `getValue()` Returns the stored interval information as a string.
`void` `setMonths(int months)` Override the parent setMonths method disallowing a non-zero value.
`void` `setValue(int month, long time)` Override the parent setValue method disallowing a non-zero value for month.
`void` `setValue(long time)` Set all values of this interval using just one specified value.
`void` `setYears(int years)` Override the parent setYears method disallowing a non-zero value.

### Methods inherited from class com.amazon.redshift.util.RedshiftInterval

`add, add, add, clone, getDays, getHours, getMicroSeconds, getMinutes, getMonths, getSeconds, getWholeSeconds, getYears, hashCode, scale, setDays, setHours, setMinutes, setSeconds, setValue, setValue, totalMicroseconds, totalMonths`

### Methods inherited from class com.amazon.redshift.util.RedshiftObject

`getType, setType, toString`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### RedshiftIntervalDayToSecond

    public RedshiftIntervalDayToSecond()

required by the driver.

#### RedshiftIntervalDayToSecond

    public RedshiftIntervalDayToSecond(String value)
                                throws SQLException

Initialize an interval with a given interval string representation. This method simply calls the parent public method setValue().

Parameters:
  `value` - String representated interval (e.g. '3 days 4 hours 1 mins 4.30 seconds').
Throws:
  `SQLException` - Is thrown if the string representation has an unknown format.
See Also:
  `RedshiftInterval.setValue(String)`

#### RedshiftIntervalDayToSecond

    public RedshiftIntervalDayToSecond(int days,
                                       int hours,
                                       int minutes,
                                       double seconds)
                                throws SQLException

Throws:
  `SQLException`

#### RedshiftIntervalDayToSecond

    public RedshiftIntervalDayToSecond(long time)
                                throws SQLException

Throws:
  `SQLException`

### Method Detail

#### setValue

    public void setValue(long time)

Set all values of this interval using just one specified value.

Parameters:
  `time` - Total number of microseconds (assuming 1day = 24hrs = 1440mins = 86400secs = 8.64e10microsecs)

#### setValue

    public void setValue(int month,
                         long time)

Override the parent setValue method disallowing a non-zero value for month.

Overrides:
  `setValue` in class `RedshiftInterval`
Parameters:
  `month` - Should be 0.
  `time` - Total number of microseconds (assuming 1day = 24hrs = 1440mins = 86400secs = 8.64e10microsecs)

#### setYears

    public void setYears(int years)

Override the parent setYears method disallowing a non-zero value.

Overrides:
  `setYears` in class `RedshiftInterval`
Parameters:
  `years` - Should be 0.

#### setMonths

    public void setMonths(int months)

Override the parent setMonths method disallowing a non-zero value.

Overrides:
  `setMonths` in class `RedshiftInterval`
Parameters:
  `months` - Should be 0.

#### getValue

    public String getValue()

Returns the stored interval information as a string.

Overrides:
  `getValue` in class `RedshiftInterval`
Returns:
  String represented interval

#### add

    public void add(RedshiftIntervalDayToSecond interval)

Add this interval's value to the passed interval. This is backwards to what I would expect, but this makes it match the other existing add methods.

Parameters:
  `interval` - intval to add

#### equals

    public boolean equals(Object obj)

Returns whether an object is equal to this one or not.

Overrides:
  `equals` in class `RedshiftInterval`
Parameters:
  `obj` - Object to compare with
Returns:
  true if the two intervals are identical