1818 Conversion type for date-time conversion.
1919* ` static CBORDateConverter TaggedNumber ` <br >
2020 A converter object where FromCBORObject accepts CBOR objects with tag 0
21- (date/time strings) and tag 1 (number of seconds since the start
22- of 1970), and ToCBORObject converts date/time objects (java.util.Date
23- in DotNet, and Date in Java) to CBOR objects of tag 1.
21+ (date/time strings) and tag 1 (number of seconds since the start of
22+ 1970), and ToCBORObject converts date/time objects (java.util.Date in
23+ DotNet, and Date in Java) to CBOR objects of tag 1.
2424* ` static CBORDateConverter TaggedString ` <br >
2525 A converter object where FromCBORObject accepts CBOR objects with tag 0
26- (date/time strings) and tag 1 (number of seconds since the start
27- of 1970), and ToCBORObject converts date/time objects (java.util.Date
28- in DotNet, and Date in Java) to CBOR objects of tag 0.
26+ (date/time strings) and tag 1 (number of seconds since the start of
27+ 1970), and ToCBORObject converts date/time objects (java.util.Date in
28+ DotNet, and Date in Java) to CBOR objects of tag 0.
2929* ` static CBORDateConverter UntaggedNumber ` <br >
3030 A converter object where FromCBORObject accepts untagged CBOR integer or
3131 CBOR floating-point objects that give the number of seconds since
32- the start of 1970, and where ToCBORObject converts date/time
33- objects (java.util.Date in DotNet, and Date in Java) to such untagged
34- CBOR objects.
32+ the start of 1970, and where ToCBORObject converts date/time objects
33+ (java.util.Date in DotNet, and Date in Java) to such untagged CBOR
34+ objects.
3535
3636## Nested Classes
3737
5050* `CBORObject DateTimeFieldsToCBORObject(int smallYear,
5151 int month,
5252 int day)`<br >
53- Not documented yet .
53+ Converts a date/time in the form of a year, month, and day to a CBOR object .
5454* `CBORObject DateTimeFieldsToCBORObject(int smallYear,
5555 int month,
5656 int day,
5757 int hour,
5858 int minute,
5959 int second)`<br >
60- Not documented yet.
60+ Converts a date/time in the form of a year, month, day, hour, minute, and
61+ second to a CBOR object.
6162* `CBORObject DateTimeFieldsToCBORObject(com.upokecenter.numbers.EInteger bigYear,
6263 int[ ] lesserFields)`<br >
63- Not documented yet.
64+ Converts a date/time in the form of a year, month, day, hour, minute,
65+ second, fractional seconds, and time offset to a CBOR object.
6466* ` java.util.Date FromCBORObject(CBORObject obj) ` <br >
65- Not documented yet.
67+ Converts a CBOR object to a java.util.Date (in DotNet) or a Date (in Java).
68+ * ` CBORDateConverter.ConversionType getType() ` <br >
69+ Gets the conversion type for this date converter.
6670* ` CBORObject ToCBORObject(java.util.Date obj) ` <br >
67- Not documented yet.
71+ Converts a java.util.Date (in DotNet) or Date (in Java) to a CBOR object in a
72+ manner specified by this converter's conversion type.
6873* `boolean TryGetDateTimeFields(CBORObject obj,
6974 com.upokecenter.numbers.EInteger[ ] year,
7075 int[ ] lesserFields)`<br >
7580### TaggedString
7681 public static final CBORDateConverter TaggedString
7782A converter object where FromCBORObject accepts CBOR objects with tag 0
78- (date/time strings) and tag 1 (number of seconds since the start
79- of 1970), and ToCBORObject converts date/time objects (java.util.Date
80- in DotNet, and Date in Java) to CBOR objects of tag 0.
83+ (date/time strings) and tag 1 (number of seconds since the start of
84+ 1970), and ToCBORObject converts date/time objects (java.util.Date in
85+ DotNet, and Date in Java) to CBOR objects of tag 0.
8186### TaggedNumber
8287 public static final CBORDateConverter TaggedNumber
8388A converter object where FromCBORObject accepts CBOR objects with tag 0
84- (date/time strings) and tag 1 (number of seconds since the start
85- of 1970), and ToCBORObject converts date/time objects (java.util.Date
86- in DotNet, and Date in Java) to CBOR objects of tag 1. The
87- ToCBORObject conversion is lossless only if the number of seconds
88- since the start of 1970 can be represented exactly as an integer
89- in the interval [ -(2^64), 2^64 - 1] or as a 64-bit floating-point
90- number in the IEEE 754r binary64 format; the conversion is lossy
91- otherwise. The ToCBORObject conversion will throw an exception if
92- the conversion to binary64 results in positive infinity, negative
93- infinity, or not-a-number.
89+ (date/time strings) and tag 1 (number of seconds since the start of
90+ 1970), and ToCBORObject converts date/time objects (java.util.Date in
91+ DotNet, and Date in Java) to CBOR objects of tag 1. The ToCBORObject
92+ conversion is lossless only if the number of seconds since the start
93+ of 1970 can be represented exactly as an integer in the interval
94+ [ -(2^64), 2^64 - 1] or as a 64-bit floating-point number in the IEEE
95+ 754r binary64 format; the conversion is lossy otherwise. The
96+ ToCBORObject conversion will throw an exception if the conversion to
97+ binary64 results in positive infinity, negative infinity, or
98+ not-a-number.
9499### UntaggedNumber
95100 public static final CBORDateConverter UntaggedNumber
96101A converter object where FromCBORObject accepts untagged CBOR integer or
97102 CBOR floating-point objects that give the number of seconds since
98- the start of 1970, and where ToCBORObject converts date/time
99- objects (java.util.Date in DotNet, and Date in Java) to such untagged
100- CBOR objects. The ToCBORObject conversion is lossless only if the
101- number of seconds since the start of 1970 can be represented
102- exactly as an integer in the interval [ -(2^64), 2^64 - 1] or as a
103- 64-bit floating-point number in the IEEE 754r binary64 format;
104- the conversion is lossy otherwise. The ToCBORObject conversion
105- will throw an exception if the conversion to binary64 results in
106- positive infinity, negative infinity, or not-a-number.
103+ the start of 1970, and where ToCBORObject converts date/time objects
104+ (java.util.Date in DotNet, and Date in Java) to such untagged CBOR
105+ objects. The ToCBORObject conversion is lossless only if the number
106+ of seconds since the start of 1970 can be represented exactly as an
107+ integer in the interval [ -(2^64), 2^64 - 1] or as a 64-bit
108+ floating-point number in the IEEE 754r binary64 format; the
109+ conversion is lossy otherwise. The ToCBORObject conversion will
110+ throw an exception if the conversion to binary64 results in positive
111+ infinity, negative infinity, or not-a-number.
107112## Method Details
108113
114+ ### getType
115+ public final CBORDateConverter.ConversionType getType()
116+ Gets the conversion type for this date converter.
117+
118+ ** Returns:**
119+
120+ * The conversion type for this date converter.
121+
109122### FromCBORObject
110123 public java.util.Date FromCBORObject(CBORObject obj)
111- Not documented yet .
124+ Converts a CBOR object to a java.util.Date (in DotNet) or a Date (in Java) .
112125
113126** Specified by:**
114127
115128* <code >FromCBORObject</code > in interface <code >ICBORToFromConverter< ; java.util.Date> ; </code >
116129
117130** Parameters:**
118131
119- * <code >obj</code > - The parameter <code >obj</code > is a Cbor.CBORObject object.
132+ * <code >obj</code > - A CBOR object that specifies a date/time according to the
133+ conversion type used to create this date converter.
120134
121135** Returns:**
122136
123- * The return value is not documented yet.
137+ * A java.util.Date or Date that encodes the date/time specified in the CBOR
138+ object.
124139
125140** Throws:**
126141
127142* <code >java.lang.NullPointerException</code > - The parameter <code >obj</code > is null.
128143
144+ * <code >CBORException</code > - The format of the CBOR object is
145+ not supported, or another error occurred in conversion.
146+
129147### TryGetDateTimeFields
130148 public boolean TryGetDateTimeFields(CBORObject obj, com.upokecenter.numbers.EInteger[] year, int[] lesserFields)
131149Tries to extract the fields of a date and time in the form of a CBOR object.
132150
133151** Parameters:**
134152
135- * <code >obj</code > - The parameter <code >obj</code > is a Cbor.CBORObject object.
153+ * <code >obj</code > - A CBOR object that specifies a date/time according to the
154+ conversion type used to create this date converter.
136155
137156* <code >year</code > - An array whose first element will store the year. The array's
138- length must be 1 or greater. If this function fails, the first element
139- is set to null.
157+ length must be 1 or greater. If this function fails, the first
158+ element is set to null.
140159
141160* <code >lesserFields</code > - An array that will store the fields (other than the
142161 year) of the date and time. The array's length must be 7 or greater.
143- If this function fails, the first seven elements are set to 0. If this
144- method is successful, the first seven elements of the array (starting
145- at 0) will be as follows: <ul > <li >0 - Month of the year, from 1
146- (January) through 12 (December).</li > <li >1 - Day of the month, from 1
147- through 31.</li > <li >2 - Hour of the day, from 0 through 23.</ li >
148- < li >3 - Minute of the hour, from 0 through 59.</li > < li >4 - Second of
149- the minute, from 0 through 59.</li > <li >5 - Fractional seconds,
150- expressed in nanoseconds. This value cannot be less than 0.</ li > < li >6
151- - Number of minutes to subtract from this date and time to get global
152- time. This number can be positive or negative, but cannot be less than
153- -1439 or greater than 1439. For tags 0 and 1, this value is always
154- 0.</li ></ul >.
162+ If this function fails, the first seven elements are set to 0. If
163+ this method is successful, the first seven elements of the array
164+ (starting at 0) will be as follows: <ul > <li >0 - Month of the year,
165+ from 1 (January) through 12 (December).</li > <li >1 - Day of the
166+ month, from 1 through 31.</li > <li >2 - Hour of the day, from 0
167+ through 23.</ li > < li > 3 - Minute of the hour, from 0 through 59.</li >
168+ < li >4 - Second of the minute, from 0 through 59.</li > <li >5 -
169+ Fractional seconds, expressed in nanoseconds. This value cannot be
170+ less than 0.</ li > < li >6 - Number of minutes to subtract from this
171+ date and time to get global time . This number can be positive or
172+ negative, but cannot be less than -1439 or greater than 1439. For
173+ tags 0 and 1, this value is always 0.</li ></ul >.
155174
156175** Returns:**
157176
@@ -165,7 +184,9 @@ Tries to extract the fields of a date and time in the form of a CBOR object.
165184
166185### DateTimeFieldsToCBORObject
167186 public CBORObject DateTimeFieldsToCBORObject(int smallYear, int month, int day)
168- Not documented yet.
187+ Converts a date/time in the form of a year, month, and day to a CBOR object.
188+ The hour, minute, and second are treated as 00:00:00 by this method,
189+ and the time offset is treated as 0 by this method.
169190
170191** Parameters:**
171192
@@ -180,9 +201,15 @@ Not documented yet.
180201* A CBOR object encoding the given date fields according to the
181202 conversion type used to create this date converter.
182203
204+ ** Throws:**
205+
206+ * <code >CBORException</code > - An error occurred in conversion.
207+
183208### DateTimeFieldsToCBORObject
184209 public CBORObject DateTimeFieldsToCBORObject(int smallYear, int month, int day, int hour, int minute, int second)
185- Not documented yet.
210+ Converts a date/time in the form of a year, month, day, hour, minute, and
211+ second to a CBOR object. The time offset is treated as 0 by this
212+ method.
186213
187214** Parameters:**
188215
@@ -203,9 +230,14 @@ Not documented yet.
203230* A CBOR object encoding the given date fields according to the
204231 conversion type used to create this date converter.
205232
233+ ** Throws:**
234+
235+ * <code >CBORException</code > - An error occurred in conversion.
236+
206237### DateTimeFieldsToCBORObject
207238 public CBORObject DateTimeFieldsToCBORObject(com.upokecenter.numbers.EInteger bigYear, int[] lesserFields)
208- Not documented yet.
239+ Converts a date/time in the form of a year, month, day, hour, minute,
240+ second, fractional seconds, and time offset to a CBOR object.
209241
210242** Parameters:**
211243
@@ -225,9 +257,12 @@ Not documented yet.
225257* <code >java.lang.NullPointerException</code > - The parameter <code >bigYear</code > or <code >
226258 lesserFields</code > is null.
227259
260+ * <code >CBORException</code > - An error occurred in conversion.
261+
228262### ToCBORObject
229263 public CBORObject ToCBORObject(java.util.Date obj)
230- Not documented yet.
264+ Converts a java.util.Date (in DotNet) or Date (in Java) to a CBOR object in a
265+ manner specified by this converter's conversion type.
231266
232267** Specified by:**
233268
@@ -239,4 +274,9 @@ Not documented yet.
239274
240275** Returns:**
241276
242- * The return value is not documented yet.
277+ * A CBOR object encoding the date/time in the java.util.Date or Date
278+ according to the conversion type used to create this date converter.
279+
280+ ** Throws:**
281+
282+ * <code >CBORException</code > - An error occurred in conversion.
0 commit comments