Constructor and Description |
---|
SimpleTimeZone(int offset,
String timezone)
Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID
with no daylight saving time schedule.
|
SimpleTimeZone(int ofs,
String abbr,
int stmon,
int stday,
int stdow,
int sttim,
int enmon,
int enday,
int endow,
int entim)
Creates a SimpleTimeZone.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a copy of this TimeZone.
|
boolean |
equals(Object obj)
Compares two Objects for equality.
|
int |
getOffset(int era,
int year,
int month,
int day,
int dow,
int tod)
Gets the time zone offset, for current date, modified in case of daylight savings.
|
int |
getRawOffset()
Returns the amount of time in milliseconds to add to UTC to get standard time in this time zone.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
inDaylightTime(Date date)
Queries if the given date is in Daylight Saving Time in this time zone.
|
void |
setEndRule(int i,
int j,
int k,
int l) |
void |
setRawOffset(int i)
Sets the base time zone offset to UTC.
|
void |
setStartRule(int i,
int j,
int k,
int l) |
void |
setStartYear(int i) |
String |
toString()
Returns a string representation of the object.
|
boolean |
useDaylightTime()
Retrieves the Daylight Saving Time (DST) enable flag.
|
getAvailableIDs, getAvailableIDs, getDefault, getID, getTimeZone, setDefault, setID
public SimpleTimeZone(int offset, String timezone)
offset
- The base time zone offset in milliseconds to UTC.timezone
- time zone namepublic SimpleTimeZone(int ofs, String abbr, int stmon, int stday, int stdow, int sttim, int enmon, int enday, int endow, int entim)
ofs
- ?abbr
- ?stmon
- ?stday
- ?stdow
- ?sttim
- ?enmon
- ?enday
- ?endow
- ?entim
- ?public Object clone()
TimeZone
public boolean equals(Object obj)
Object
The equals
method implements an equivalence relation:
x
,
x.equals(x)
should return true
.
x
and
y
, x.equals(y)
should return
true
if and only if y.equals(x)
returns
true
.
x
,
y
, and z
, if x.equals(y)
returns true
and y.equals(z)
returns
true
, then x.equals(z)
should return
true
.
x
and y
, multiple invocations of x.equals(y)
consistently return true
or consistently return
false
.
x
, x.equals(null)
should return false
.
The equals method for class Object
implements the most
discriminating possible equivalence relation on objects; that is,
for any reference values x
and y
, this
method returns true
if and only if x
and
y
refer to the same object (x==y
has the
value true
).
equals
in class Object
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Boolean.hashCode()
,
Hashtable
public int getOffset(int era, int year, int month, int day, int dow, int tod)
getOffset
in class TimeZone
era
- the era of the given dateyear
- the year of the given datemonth
- the month in the given date (0-based, e.g. January is 0)day
- the day of the month in the given datedow
- the day of the week in the given datetod
- the time of the day in milliseconds in standard local timepublic int getRawOffset()
TimeZone
getRawOffset
in class TimeZone
public int hashCode()
Object
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer. This integer need not
remain consistent from one execution of an application to another
execution of the same application.
equals
method, then calling the hashCode
method on each of the
two objects must produce the same integer result.
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public boolean inDaylightTime(Date date)
TimeZone
inDaylightTime
in class TimeZone
date
- ?public void setEndRule(int i, int j, int k, int l)
i
- ?j
- ?k
- ?l
- ?public void setRawOffset(int i)
TimeZone
setRawOffset
in class TimeZone
i
- ?public void setStartRule(int i, int j, int k, int l)
i
- ?j
- ?k
- ?l
- ?public void setStartYear(int i)
i
- ?public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object.
public boolean useDaylightTime()
useDaylightTime
in class TimeZone