| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private boolean | |
| private static final int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PGInterval(String
String representated interval (e.g. '3 years 2 mons') value)Initialize a interval with a given interval string representation. |
| public | PGInterval(int
years years, int months months, int days days, int hours hours, int minutes minutes, double seconds seconds)Initializes all values of this interval to the specified values. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public Object | clone()
Overrides org. This must be overridden to allow the object to be cloned. |
| public boolean | Returns: true if the two intervals are identicalObject to compare with obj)Overrides java. Returns whether an object is equal to this one or not. |
| public int | |
| public int | Returns: hours represented by this intervalReturns the hours represented by this interval. |
| public int | |
| public int | Returns: minutes represented by this intervalReturns the minutes represented by this interval. |
| public int | Returns: months represented by this intervalReturns the months represented by this interval. |
| public double | Returns: seconds represented by this intervalReturns the seconds represented by this interval. |
| public @Nullable String | Returns: String represented intervalOverrides org. Returns the stored interval information as a string. |
| public int | |
| public int | Returns: years represented by this intervalReturns the years represented by this interval. |
| public int | Returns: hashCodeOverrides org. Returns a hashCode for this object. |
| private int | |
| private static double | Returns: double parsed from string valuedouble as string value value)Returns double value of value or 0 if value is null. |
| private static int | Returns: integer parsed from string valueinteger as string value value)Returns integer value of value or 0 if value is null. |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setValue(int
years years, int months months, int days days, int hours hours, int minutes minutes, double seconds seconds)Set all values of this interval to the specified values. |
| public void |
| days | back to summary |
|---|---|
| private int days | |
| hours | back to summary |
|---|---|
| private int hours | |
| isNull | back to summary |
|---|---|
| private boolean isNull | |
| MICROS_IN_SECOND | back to summary |
|---|---|
| private static final int MICROS_IN_SECOND | |
| microSeconds | back to summary |
|---|---|
| private int microSeconds | |
| minutes | back to summary |
|---|---|
| private int minutes | |
| months | back to summary |
|---|---|
| private int months | |
| wholeSeconds | back to summary |
|---|---|
| private int wholeSeconds | |
| years | back to summary |
|---|---|
| private int years | |
| PGInterval | back to summary |
|---|---|
| public PGInterval() required by the driver. | |
| PGInterval | back to summary |
|---|---|
| public PGInterval(String value) throws SQLException Initialize a interval with a given interval string representation.
| |
| PGInterval | back to summary |
|---|---|
| public PGInterval(int years, int months, int days, int hours, int minutes, double seconds) Initializes all values of this interval to the specified values.
| |
| add | back to summary |
|---|---|
| public void add(Calendar cal) Rolls this interval on a given calendar.
| |
| add | back to summary |
|---|---|
| public void add(Date date) Rolls this interval on a given date.
| |
| add | back to summary |
|---|---|
| public void add(PGInterval 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.
| |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides org. Doc from org. This must be overridden to allow the object to be cloned.
| |
| equals | back to summary |
|---|---|
| public boolean equals(@Nullable Object obj) Overrides java. Returns whether an object is equal to this one or not. | |
| getDays | back to summary |
|---|---|
| public int getDays() Returns the days represented by this interval.
| |
| getHours | back to summary |
|---|---|
| public int getHours() Returns the hours represented by this interval.
| |
| getMicroSeconds | back to summary |
|---|---|
| public int getMicroSeconds() | |
| getMinutes | back to summary |
|---|---|
| public int getMinutes() Returns the minutes represented by this interval.
| |
| getMonths | back to summary |
|---|---|
| public int getMonths() Returns the months represented by this interval.
| |
| getSeconds | back to summary |
|---|---|
| public double getSeconds() Returns the seconds represented by this interval.
| |
| getValue | back to summary |
|---|---|
| public @Nullable String getValue() Overrides org. Returns the stored interval information as a string. | |
| getWholeSeconds | back to summary |
|---|---|
| public int getWholeSeconds() | |
| getYears | back to summary |
|---|---|
| public int getYears() Returns the years represented by this interval.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides org. Returns a hashCode for this object.
| |
| lookAhead | back to summary |
|---|---|
| private int lookAhead(String value, int position, String find) | |
| nullSafeDoubleGet | back to summary |
|---|---|
| private static double nullSafeDoubleGet(@Nullable String value) throws NumberFormatException Returns double value of value or 0 if value is null.
| |
| nullSafeIntGet | back to summary |
|---|---|
| private static int nullSafeIntGet(@Nullable String value) throws NumberFormatException Returns integer value of value or 0 if value is null.
| |
| parseISO8601Format | back to summary |
|---|---|
| private void parseISO8601Format(String value) | |
| scale | back to summary |
|---|---|
| public void scale(int factor) 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 | back to summary |
|---|---|
| public void setDays(int days) Set the days of this interval to the specified value.
| |
| setHours | back to summary |
|---|---|
| public void setHours(int hours) Set the hours of this interval to the specified value.
| |
| setMinutes | back to summary |
|---|---|
| public void setMinutes(int minutes) Set the minutes of this interval to the specified value.
| |
| setMonths | back to summary |
|---|---|
| public void setMonths(int months) Set the months of this interval to the specified value.
| |
| setSeconds | back to summary |
|---|---|
| public void setSeconds(double seconds) Set the seconds of this interval to the specified value.
| |
| setValue | back to summary |
|---|---|
| public void setValue(@Nullable String value) throws SQLException 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').
| |
| setValue | back to summary |
|---|---|
| public void setValue(int years, int months, int days, int hours, int minutes, double seconds) Set all values of this interval to the specified values.
| |
| setYears | back to summary |
|---|---|
| public void setYears(int years) Set the years of this interval to the specified value.
| |