001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/util/tags/sakai_2-4-1/util-api/api/src/java/org/sakaiproject/time/cover/TimeService.java $
003: * $Id: TimeService.java 8387 2006-04-27 03:10:39Z ggolden@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.time.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * TimeService is a static Cover for the {@link org.sakaiproject.time.api.TimeService TimeService}; see that interface for usage details.
027: * </p>
028: */
029: public class TimeService {
030: public static java.lang.String APPLICATION_ID = org.sakaiproject.time.api.TimeService.APPLICATION_ID;
031:
032: public static java.lang.String TIMEZONE_KEY = org.sakaiproject.time.api.TimeService.TIMEZONE_KEY;
033:
034: /**
035: * Access the component instance: special cover only method.
036: *
037: * @return the component instance.
038: */
039: public static org.sakaiproject.time.api.TimeService getInstance() {
040: if (ComponentManager.CACHE_COMPONENTS) {
041: if (m_instance == null)
042: m_instance = (org.sakaiproject.time.api.TimeService) ComponentManager
043: .get(org.sakaiproject.time.api.TimeService.class);
044: return m_instance;
045: } else {
046: return (org.sakaiproject.time.api.TimeService) ComponentManager
047: .get(org.sakaiproject.time.api.TimeService.class);
048: }
049: }
050:
051: private static org.sakaiproject.time.api.TimeService m_instance = null;
052:
053: public static org.sakaiproject.time.api.Time newTimeGmt(
054: java.lang.String param0) {
055: org.sakaiproject.time.api.TimeService service = getInstance();
056: if (service == null)
057: return null;
058:
059: return service.newTimeGmt(param0);
060: }
061:
062: public static org.sakaiproject.time.api.Time newTimeGmt(int param0,
063: int param1, int param2, int param3, int param4, int param5,
064: int param6) {
065: org.sakaiproject.time.api.TimeService service = getInstance();
066: if (service == null)
067: return null;
068:
069: return service.newTimeGmt(param0, param1, param2, param3,
070: param4, param5, param6);
071: }
072:
073: public static org.sakaiproject.time.api.Time newTimeGmt(
074: org.sakaiproject.time.api.TimeBreakdown param0) {
075: org.sakaiproject.time.api.TimeService service = getInstance();
076: if (service == null)
077: return null;
078:
079: return service.newTimeGmt(param0);
080: }
081:
082: public static org.sakaiproject.time.api.Time newTimeLocal(
083: org.sakaiproject.time.api.TimeBreakdown param0) {
084: org.sakaiproject.time.api.TimeService service = getInstance();
085: if (service == null)
086: return null;
087:
088: return service.newTimeLocal(param0);
089: }
090:
091: public static org.sakaiproject.time.api.Time newTimeLocal(
092: int param0, int param1, int param2, int param3, int param4,
093: int param5, int param6) {
094: org.sakaiproject.time.api.TimeService service = getInstance();
095: if (service == null)
096: return null;
097:
098: return service.newTimeLocal(param0, param1, param2, param3,
099: param4, param5, param6);
100: }
101:
102: public static org.sakaiproject.time.api.TimeBreakdown newTimeBreakdown(
103: int param0, int param1, int param2, int param3, int param4,
104: int param5, int param6) {
105: org.sakaiproject.time.api.TimeService service = getInstance();
106: if (service == null)
107: return null;
108:
109: return service.newTimeBreakdown(param0, param1, param2, param3,
110: param4, param5, param6);
111: }
112:
113: public static org.sakaiproject.time.api.TimeRange newTimeRange(
114: org.sakaiproject.time.api.Time param0,
115: org.sakaiproject.time.api.Time param1) {
116: org.sakaiproject.time.api.TimeService service = getInstance();
117: if (service == null)
118: return null;
119:
120: return service.newTimeRange(param0, param1);
121: }
122:
123: public static org.sakaiproject.time.api.TimeRange newTimeRange(
124: org.sakaiproject.time.api.Time param0) {
125: org.sakaiproject.time.api.TimeService service = getInstance();
126: if (service == null)
127: return null;
128:
129: return service.newTimeRange(param0);
130: }
131:
132: public static org.sakaiproject.time.api.TimeRange newTimeRange(
133: long param0, long param1) {
134: org.sakaiproject.time.api.TimeService service = getInstance();
135: if (service == null)
136: return null;
137:
138: return service.newTimeRange(param0, param1);
139: }
140:
141: public static org.sakaiproject.time.api.TimeRange newTimeRange(
142: org.sakaiproject.time.api.Time param0,
143: org.sakaiproject.time.api.Time param1, boolean param2,
144: boolean param3) {
145: org.sakaiproject.time.api.TimeService service = getInstance();
146: if (service == null)
147: return null;
148:
149: return service.newTimeRange(param0, param1, param2, param3);
150: }
151:
152: public static org.sakaiproject.time.api.TimeRange newTimeRange(
153: java.lang.String param0) {
154: org.sakaiproject.time.api.TimeService service = getInstance();
155: if (service == null)
156: return null;
157:
158: return service.newTimeRange(param0);
159: }
160:
161: public static org.sakaiproject.time.api.Time newTime(long param0) {
162: org.sakaiproject.time.api.TimeService service = getInstance();
163: if (service == null)
164: return null;
165:
166: return service.newTime(param0);
167: }
168:
169: public static org.sakaiproject.time.api.Time newTime() {
170: org.sakaiproject.time.api.TimeService service = getInstance();
171: if (service == null)
172: return null;
173:
174: return service.newTime();
175: }
176:
177: public static java.util.TimeZone getLocalTimeZone() {
178: org.sakaiproject.time.api.TimeService service = getInstance();
179: if (service == null)
180: return null;
181:
182: return service.getLocalTimeZone();
183: }
184:
185: public static boolean clearLocalTimeZone(String param0) {
186: org.sakaiproject.time.api.TimeService service = getInstance();
187: if (service == null)
188: return false;
189:
190: return service.clearLocalTimeZone(param0);
191: }
192:
193: public static java.util.GregorianCalendar getCalendar(
194: java.util.TimeZone param0, int param1, int param2,
195: int param3, int param4, int param5, int param6, int param7) {
196: org.sakaiproject.time.api.TimeService service = getInstance();
197: if (service == null)
198: return null;
199:
200: return service.getCalendar(param0, param1, param2, param3,
201: param4, param5, param6, param7);
202: }
203:
204: public static org.sakaiproject.time.api.Time newTime(
205: java.util.GregorianCalendar param0) {
206: org.sakaiproject.time.api.TimeService service = getInstance();
207: if (service == null)
208: return null;
209:
210: return service.newTime(param0);
211: }
212:
213: public static boolean different(
214: org.sakaiproject.time.api.Time param0,
215: org.sakaiproject.time.api.Time param1) {
216: org.sakaiproject.time.api.TimeService service = getInstance();
217: if (service == null)
218: return false;
219:
220: return service.different(param0, param1);
221: }
222: }
|