| java.lang.Object org.postgresql.util.PGobject org.postgresql.util.PGInterval
Constructor Summary | |
public | PGInterval() | public | PGInterval(String value) Initialize a interval with a given interval string representation
Parameters: value - String representated interval (e.g. | public | PGInterval(int years, int months, int days, int hours, int minutes, double seconds) |
PGInterval | public PGInterval()(Code) | | required by the driver
|
PGInterval | public PGInterval(String value) throws SQLException(Code) | | Initialize a interval with a given interval string representation
Parameters: value - String representated interval (e.g. '3 years 2 mons') throws: SQLException - Is thrown if the string representation has an unknown format See Also: PGInterval.setValue(String) |
PGInterval | public PGInterval(int years, int months, int days, int hours, int minutes, double seconds)(Code) | | Initializes all values of this interval to the specified values
See Also: PGInterval.setValue(int,int,int,int,int,double) |
add | public void add(Calendar cal)(Code) | | Rolls this interval on a given calendar
Parameters: cal - Calendar instance to add to |
add | public void add(Date date)(Code) | | Rolls this interval on a given date
Parameters: date - Date instance to add to |
add | public void add(PGInterval interval)(Code) | | 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.
|
equals | public boolean equals(Object obj)(Code) | | Returns whether an object is equal to this one or not
Parameters: obj - Object to compare with true if the two intervals are identical |
getDays | public int getDays()(Code) | | Returns the days represented by this interval
|
getHours | public int getHours()(Code) | | Returns the hours represented by this interval
|
getMinutes | public int getMinutes()(Code) | | Returns the minutes represented by this interval
|
getMonths | public int getMonths()(Code) | | Returns the months represented by this interval
|
getSeconds | public double getSeconds()(Code) | | Returns the seconds represented by this interval
|
getValue | public String getValue()(Code) | | Returns the stored interval information as a string
String represented interval |
getYears | public int getYears()(Code) | | Returns the years represented by this interval
|
hashCode | public int hashCode()(Code) | | Returns a hashCode for this object
hashCode |
scale | public void scale(int factor)(Code) | | Scale this interval by an integer factor. The server
can scale by arbitrary factors, but that would require
adjusting the call signatures for all the existing methods
like getDays() or providing our own justification of fractional
intervals. Neither of these seem like a good idea without a
strong use case.
|
setDays | public void setDays(int days)(Code) | | Set the days of this interval to the specified value
|
setHours | public void setHours(int hours)(Code) | | Set the hours of this interval to the specified value
|
setMinutes | public void setMinutes(int minutes)(Code) | | Set the minutes of this interval to the specified value
|
setMonths | public void setMonths(int months)(Code) | | Set the months of this interval to the specified value
|
setSeconds | public void setSeconds(double seconds)(Code) | | Set the seconds of this interval to the specified value
|
setValue | public void setValue(String value) throws SQLException(Code) | | Sets a interval string represented value to this instance.
This method only recognize the format, that Postgres returns -
not all input formats are supported (e.g. '1 yr 2 m 3 s')!
Parameters: value - String representated interval (e.g. '3 years 2 mons') throws: SQLException - Is thrown if the string representation has an unknown format |
setValue | public void setValue(int years, int months, int days, int hours, int minutes, double seconds)(Code) | | Set all values of this interval to the specified values
|
setYears | public void setYears(int years)(Code) | | Set the years of this interval to the specified value
|
|
|