|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.postgresql.util.PGobject
org.postgresql.util.PGInterval
public class PGInterval
This implements a class that handles the PostgreSQL interval type
Field Summary |
---|
Fields inherited from class org.postgresql.util.PGobject |
---|
type, value |
Constructor Summary | |
---|---|
PGInterval()
required by the driver |
|
PGInterval(int years,
int months,
int days,
int hours,
int minutes,
double seconds)
Initializes all values of this interval to the specified values |
|
PGInterval(java.lang.String value)
Initialize a interval with a given interval string representation |
Method Summary | |
---|---|
void |
add(java.util.Calendar cal)
Rolls this interval on a given calendar |
void |
add(java.util.Date date)
Rolls this interval on a given date |
void |
add(PGInterval interval)
Add this interval's value to the passed interval. |
boolean |
equals(java.lang.Object obj)
Returns whether an object is equal to this one or not |
int |
getDays()
Returns the days represented by this interval |
int |
getHours()
Returns the hours represented by this interval |
int |
getMinutes()
Returns the minutes represented by this interval |
int |
getMonths()
Returns the months represented by this interval |
double |
getSeconds()
Returns the seconds represented by this interval |
java.lang.String |
getValue()
Returns the stored interval information as a string |
int |
getYears()
Returns the years represented by this interval |
int |
hashCode()
Returns a hashCode for this object |
void |
scale(int factor)
Scale this interval by an integer factor. |
void |
setDays(int days)
Set the days of this interval to the specified value |
void |
setHours(int hours)
Set the hours of this interval to the specified value |
void |
setMinutes(int minutes)
Set the minutes of this interval to the specified value |
void |
setMonths(int months)
Set the months of this interval to the specified value |
void |
setSeconds(double seconds)
Set the seconds of this interval to the specified value |
void |
setValue(int years,
int months,
int days,
int hours,
int minutes,
double seconds)
Set all values of this interval to the specified values |
void |
setValue(java.lang.String value)
Sets a interval string represented value to this instance. |
void |
setYears(int years)
Set the years of this interval to the specified value |
Methods inherited from class org.postgresql.util.PGobject |
---|
clone, getType, setType, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PGInterval()
public PGInterval(java.lang.String value) throws java.sql.SQLException
value
- String representated interval (e.g. '3 years 2 mons')
java.sql.SQLException
- Is thrown if the string representation has an unknown formatsetValue(String)
public PGInterval(int years, int months, int days, int hours, int minutes, double seconds)
setValue(int, int, int, int, int, double)
Method Detail |
---|
public void setValue(java.lang.String value) throws java.sql.SQLException
setValue
in class PGobject
value
- String representated interval (e.g. '3 years 2 mons')
java.sql.SQLException
- Is thrown if the string representation has an unknown formatpublic void setValue(int years, int months, int days, int hours, int minutes, double seconds)
public java.lang.String getValue()
getValue
in class PGobject
public int getYears()
public void setYears(int years)
public int getMonths()
public void setMonths(int months)
public int getDays()
public void setDays(int days)
public int getHours()
public void setHours(int hours)
public int getMinutes()
public void setMinutes(int minutes)
public double getSeconds()
public void setSeconds(double seconds)
public void add(java.util.Calendar cal)
cal
- Calendar instance to add topublic void add(java.util.Date date)
date
- Date instance to add topublic void add(PGInterval interval)
public void scale(int factor)
public boolean equals(java.lang.Object obj)
equals
in class PGobject
obj
- Object to compare with
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |