001/* 002 * Copyright 2008 Marc Wick, geonames.org 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 */ 017package org.geonames; 018 019import java.util.Date; 020 021/** 022 * gmtOffset and dstOffset are computed on the server with the 023 * {@link java.util.TimeZone} and included in the web service as not all 024 * geonames users are using java. 025 * 026 * @author marc 027 * 028 */ 029public class Timezone { 030 031 private String timezoneId; 032 private String countryCode; 033 private Date time; 034 private Date sunrise; 035 private Date sunset; 036 037 @Deprecated 038 private double gmtOffset; 039 040 @Deprecated 041 private double dstOffset; 042 043 /** 044 * the dstOffset as of first of July of current year 045 * 046 * @return the dstOffset 047 */ 048 @Deprecated 049 public double getDstOffset() { 050 return dstOffset; 051 } 052 053 /** 054 * @param dstOffset 055 * the dstOffset to set 056 */ 057 public void setDstOffset(double dstOffset) { 058 this.dstOffset = dstOffset; 059 } 060 061 /** 062 * the gmtOffset as of first of January of current year 063 * 064 * @return the gmtOffset 065 */ 066 @Deprecated 067 public double getGmtOffset() { 068 return gmtOffset; 069 } 070 071 /** 072 * @param gmtOffset 073 * the gmtOffset to set 074 */ 075 public void setGmtOffset(double gmtOffset) { 076 this.gmtOffset = gmtOffset; 077 } 078 079 /** 080 * the timezoneId (example : "Pacific/Honolulu") 081 * 082 * see also {@link java.util.TimeZone} and 083 * http://www.twinsun.com/tz/tz-link.htm 084 * 085 * @return the timezoneId 086 */ 087 public String getTimezoneId() { 088 return timezoneId; 089 } 090 091 /** 092 * @param timezoneId 093 * the timezoneId to set 094 */ 095 public void setTimezoneId(String timezoneId) { 096 this.timezoneId = timezoneId; 097 } 098 099 /** 100 * @return the countryCode 101 */ 102 public String getCountryCode() { 103 return countryCode; 104 } 105 106 /** 107 * @param countryCode 108 * the countryCode to set 109 */ 110 public void setCountryCode(String countryCode) { 111 this.countryCode = countryCode; 112 } 113 114 /** 115 * @return the time 116 */ 117 public Date getTime() { 118 return time; 119 } 120 121 /** 122 * @param time 123 * the time to set 124 */ 125 public void setTime(Date time) { 126 this.time = time; 127 } 128 129 /** 130 * @return the sunrise 131 */ 132 public Date getSunrise() { 133 return sunrise; 134 } 135 136 /** 137 * @param sunrise 138 * the sunrise to set 139 */ 140 public void setSunrise(Date sunrise) { 141 this.sunrise = sunrise; 142 } 143 144 /** 145 * @return the sunset 146 */ 147 public Date getSunset() { 148 return sunset; 149 } 150 151 /** 152 * @param sunset 153 * the sunset to set 154 */ 155 public void setSunset(Date sunset) { 156 this.sunset = sunset; 157 } 158 159}