summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSTimestamp.java
blob: bd246e05d1e5b3cc62cd21aa7a79279a59069f6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
/*
Wotonomy: OpenStep design patterns for pure Java applications.
Copyright (C) 2002 Israfil consulting Services Corporation

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see http://www.gnu.org

$Id: NSTimestamp.java 892 2006-02-16 12:47:16Z cgruber $

*/

package net.wotonomy.foundation;

import java.sql.Timestamp;
import java.util.Date;
import java.util.TimeZone;

/**
* A channel to the database, representing a communication
* stream within a context of an adaptor.
*
* @author cgruber@israfil.net
* @author $Author: cgruber $
* @version $Revision: 892 $
*/

public class NSTimestamp extends Timestamp
    implements NSCoding {

    public static class IntRef {

        public int value = 0;

        public String toString() {
        	return getClass().getName() + " < value = " + value + " >";
        }

        public IntRef() {
        }
    }


    public static final NSTimestamp DistantPast = new NSTimestamp(0xffffc77f2e9b6800L);
    public static final NSTimestamp DistantFuture = new NSTimestamp(0x7fffffffffffffffL);
    public static long currentTimeIntervalSinceReferenceDate() {
        return System.currentTimeMillis() / 1000L;
    }

    public static NSTimestamp distantFuture() {
        return DistantFuture;
    }

    public static NSTimestamp distantPast() {
        return DistantPast;
    }

    public static long millisecondsToTimeInterval(long l) {
        return l / 1000L;
    }

    public static long timeIntervalToMilliseconds(long l) {
        return l * 1000L;
    }

    public Class classForCoder() {
        return getClass();
    }

    public static Object decodeObject(NSCoder nscoder) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public void encodeWithCoder(NSCoder nscoder) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp() {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(long l) {
    	super(l);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(long l, int i) {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(long l, NSTimestamp nstimestamp) {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(long l, TimeZone timezone) {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(long l, int i, TimeZone timezone) {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(int i, int j, int k, int l, int i1, int j1, TimeZone timezone) {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(Date date) {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp(Timestamp timestamp) {
    	super(0);
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp timestampByAddingGregorianUnits(int i, int j, int k, int l, int i1, int j1) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp timestampByAddingTimeInterval(long l) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public long dayOfCommonEra() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int dayOfMonth() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int dayOfWeek() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int dayOfYear() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int hourOfDay() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int microsecondOfSecond() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int minuteOfHour() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int monthOfYear() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int secondOfMinute() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int yearOfCommonEra() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public void gregorianUnitsSinceTimestamp(IntRef intref, IntRef intref1, IntRef intref2, IntRef intref3, IntRef intref4, IntRef intref5, NSTimestamp nstimestamp) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public long timeIntervalSinceTimestamp(NSTimestamp nstimestamp) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public long timeIntervalSinceNow() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public long timeIntervalSinceReferenceDate() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public int compare(NSTimestamp nstimestamp) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp earlierTimestamp(NSTimestamp nstimestamp) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimestamp laterTimestamp(NSTimestamp nstimestamp) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public String toString() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public NSTimeZone timeZone() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public long _getTimeInMillis() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public void setNanos(int i) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    /** @deprecated This method deprecated in parent java.util.Date */
    public void setDate(int i) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    /** @deprecated This method deprecated in parent java.util.Date */
    public void setHours(int i) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    /** @deprecated This method deprecated in parent java.util.Date */
    public void setMinutes(int i) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    /** @deprecated This method deprecated in parent java.util.Date */
    public void setMonth(int i) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    /** @deprecated This method deprecated in parent java.util.Date */
    public void setSeconds(int i) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public void setTime(long l) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    public long getTime() {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }

    /** @deprecated This method deprecated in parent java.util.Date */
    public void setYear(int i) {
		throw new UnsupportedOperationException("Not Yet Implemented");
    }
}
/*
 * $Log$
 * Revision 1.1  2006/02/16 12:47:16  cgruber
 * Check in all sources in eclipse-friendly maven-enabled packages.
 *
 * Revision 1.2  2003/08/06 23:07:52  chochos
 * general code cleanup (mostly, removing unused imports)
 *
 * Revision 1.1  2002/07/14 21:56:16  mpowers
 * Contributions from cgruber.
 *
 * Revision 1.3  2002/06/25 19:06:13  cgruber
 * Comment fix.
 *
 * Revision 1.2  2002/06/25 19:05:27  cgruber
 * Add deprecation statements to remove warnings 
 * about java.util.Date's deprecated APIs.
 *
 * Revision 1.1  2002/06/25 07:52:56  cgruber
 * Add quite a few abstract classes, interfaces, and classes.  All 
 * API consistent with WebObjects, but with no implementation, nor 
 * any private or package access members from the original.
 *
 */