Package com.ilib.tools.zic
Class Offset
- java.lang.Object
-
- com.ilib.tools.zic.Offset
-
- All Implemented Interfaces:
java.lang.Comparable<Offset>
public class Offset extends java.lang.Object implements java.lang.Comparable<Offset>
Offset - models an offset from GMT in a particular time frame. If the time zone chooses to observe daylight savings time for an offset, then the offset will have a reference to a rule set that gives information about what the start and stop rules are for observing daylight savings time in a particular time frame. If the offset does not observe daylight savings time, the numeric value of the offset from GMT will remain fixed throughout the year. Rule sets can be shared. For example, the US federal government sets a default standard rule for daylight savings time that is to be used when smaller jurisdictions do not decide to make their own variation from the standard. Thus, many time zones share the "US" rule set.
-
-
Field Summary
Fields Modifier and Type Field Description protected RelativeDate
endDate
protected java.lang.String
format
protected org.apache.log4j.Logger
logger
protected int
offsetHours
protected int
offsetMinutes
protected int
offsetSeconds
protected RuleSet
rules
protected java.lang.String
ruleSetName
protected char
zoneChar
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Offset other)
RelativeDate
getEndDate()
java.lang.String
getFormat()
org.json.JSONObject
getJson(boolean currentOnly)
int
getOffsetHours()
int
getOffsetMinutes()
int
getOffsetSeconds()
RuleSet
getRules()
void
setEndDate(RelativeDate endDate)
void
setFields(java.lang.String line, java.util.HashMap<java.lang.String,RuleSet> ruleSets, java.lang.String timeZoneName)
void
setFormat(java.lang.String format)
void
setOffsetHours(int offsetHours)
void
setOffsetMinutes(int offsetMinutes)
void
setOffsetSeconds(int offsetSeconds)
void
setRules(RuleSet rules)
-
-
-
Field Detail
-
offsetHours
protected int offsetHours
-
offsetMinutes
protected int offsetMinutes
-
offsetSeconds
protected int offsetSeconds
-
ruleSetName
protected java.lang.String ruleSetName
-
rules
protected RuleSet rules
-
format
protected java.lang.String format
-
endDate
protected RelativeDate endDate
-
logger
protected org.apache.log4j.Logger logger
-
zoneChar
protected char zoneChar
-
-
Constructor Detail
-
Offset
public Offset()
-
Offset
public Offset(java.lang.String line, java.util.HashMap<java.lang.String,RuleSet> ruleSets, java.lang.String timeZoneName) throws ParseException
- Throws:
ParseException
-
-
Method Detail
-
setFields
public void setFields(java.lang.String line, java.util.HashMap<java.lang.String,RuleSet> ruleSets, java.lang.String timeZoneName) throws ParseException
- Throws:
ParseException
-
getOffsetHours
public int getOffsetHours()
- Returns:
- the offsetHours
-
setOffsetHours
public void setOffsetHours(int offsetHours)
- Parameters:
offsetHours
- the offsetHours to set
-
getOffsetMinutes
public int getOffsetMinutes()
- Returns:
- the offsetMinutes
-
setOffsetMinutes
public void setOffsetMinutes(int offsetMinutes)
- Parameters:
offsetMinutes
- the offsetMinutes to set
-
getOffsetSeconds
public int getOffsetSeconds()
- Returns:
- the offsetSeconds
-
setOffsetSeconds
public void setOffsetSeconds(int offsetSeconds)
- Parameters:
offsetSeconds
- the offsetSeconds to set
-
getRules
public RuleSet getRules()
- Returns:
- the rules
-
setRules
public void setRules(RuleSet rules)
- Parameters:
rules
- the rules to set
-
getFormat
public java.lang.String getFormat()
- Returns:
- the format
-
setFormat
public void setFormat(java.lang.String format)
- Parameters:
format
- the format to set
-
getEndDate
public RelativeDate getEndDate()
- Returns:
- the endRule
-
setEndDate
public void setEndDate(RelativeDate endDate)
- Parameters:
endDate
- the endRule to set
-
compareTo
public int compareTo(Offset other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Offset>
-
getJson
public org.json.JSONObject getJson(boolean currentOnly) throws org.json.JSONException
- Throws:
org.json.JSONException
-
-