Skip to content

Commit e86f693

Browse files
committed
update Java version
1 parent 7e02966 commit e86f693

13 files changed

+654
-462
lines changed

api/com.upokecenter.cbor.CBORDateConverter.md

Lines changed: 99 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
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

@@ -50,21 +50,26 @@
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>
@@ -75,83 +80,97 @@
7580
### TaggedString
7681
public static final CBORDateConverter TaggedString
7782
A 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
8388
A 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
96101
A 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&lt;java.util.Date&gt;</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)
131149
Tries 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.

api/com.upokecenter.cbor.CBOREncodeOptions.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@ Specifies options for encoding and decoding CBOR objects.
1515
## Constructors
1616

1717
* `CBOREncodeOptions() CBOREncodeOptions`<br>
18-
Initializes a new instance of the CBOREncodeOptions class.
18+
Initializes a new instance of the CBOREncodeOptions class with all the default
19+
options.
1920
* `CBOREncodeOptions​(boolean useIndefLengthStrings,
20-
boolean allowDuplicateKeys) CBOREncodeOptions`<br>
21-
Initializes a new instance of the CBOREncodeOptions class.
21+
boolean allowDuplicateKeys)`<br>
22+
Deprecated.
23+
Use the more readable String constructor instead.
24+
Use the more readable String constructor instead.
2225
* `CBOREncodeOptions​(boolean useIndefLengthStrings,
2326
boolean allowDuplicateKeys,
24-
boolean ctap2Canonical) CBOREncodeOptions`<br>
25-
Initializes a new instance of the CBOREncodeOptions class.
27+
boolean ctap2Canonical)`<br>
28+
Deprecated.
29+
Use the more readable String constructor instead.
30+
Use the more readable String constructor instead.
2631
* `CBOREncodeOptions​(java.lang.String paramString) CBOREncodeOptions`<br>
2732
Initializes a new instance of the CBOREncodeOptions class.
2833

@@ -46,6 +51,10 @@ Specifies options for encoding and decoding CBOR objects.
4651
allowed when decoding, and floating-point numbers are written out in
4752
their 64-bit encoding form regardless of whether their value can be
4853
encoded without loss in a smaller form.
54+
* `boolean getFloat64()`<br>
55+
Gets a value indicating whether to encode floating-point numbers in a CBOR
56+
object in their 64-bit encoding form regardless of whether their
57+
value can be encoded without loss in a smaller form.
4958
* `boolean getResolveReferences()`<br>
5059
Gets a value indicating whether to resolve references to sharable objects
5160
and sharable strings in the process of decoding a CBOR object.
@@ -178,6 +187,20 @@ Gets a value indicating whether to allow duplicate keys when reading CBOR
178187
* A value indicating whether to allow duplicate keys when reading CBOR
179188
objects from a data stream. The default is false.
180189

190+
### getFloat64
191+
public final boolean getFloat64()
192+
Gets a value indicating whether to encode floating-point numbers in a CBOR
193+
object in their 64-bit encoding form regardless of whether their
194+
value can be encoded without loss in a smaller form. Used only when
195+
encoding CBOR objects.
196+
197+
**Returns:**
198+
199+
* Gets a value indicating whether to encode floating-point numbers in
200+
a CBOR object in their 64-bit encoding form regardless of whether
201+
their value can be encoded without loss in a smaller form. Used only
202+
when encoding CBOR objects. The default is false.
203+
181204
### getCtap2Canonical
182205
public final boolean getCtap2Canonical()
183206
Gets a value indicating whether CBOR objects: <ul> <li>When encoding, are

api/com.upokecenter.cbor.JSONOptions.ConversionMode.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ JSON numbers are decoded to CBOR as their closest-rounded approximation as
8181
numbers extremely close to zero may underflow to positive or
8282
negative zero, and numbers of extremely large absolute value may
8383
overflow to infinity.). It's important to note that this mode
84-
affects only how JSON numbers are <code>decoded</code> to a CBOR
84+
affects only how JSON numbers are <i>decoded</i> to a CBOR
8585
object; it doesn't affect how <code>EncodeToBytes</code> and other
8686
methods encode CBOR objects. Notably, by default,
8787
<code>EncodeToBytes</code> encodes CBOR floating-point values to the
@@ -101,7 +101,7 @@ A JSON number is decoded to CBOR objects either as a CBOR integer (major
101101
extremely close to zero may underflow to positive or negative
102102
zero, and numbers of extremely large absolute value may overflow
103103
to infinity.). It's important to note that this mode affects only
104-
how JSON numbers are <code>decoded</code> to a CBOR object; it doesn't
104+
how JSON numbers are <i>decoded</i> to a CBOR object; it doesn't
105105
affect how <code>EncodeToBytes</code> and other methods encode CBOR
106106
objects. Notably, by default, <code>EncodeToBytes</code> encodes CBOR
107107
floating-point values to the CBOR format in their 16-bit
@@ -121,7 +121,7 @@ A JSON number is decoded to CBOR objects either as a CBOR integer (major
121121
(In some cases, numbers extremely close to zero may underflow to
122122
zero, and numbers of extremely large absolute value may overflow
123123
to infinity.). It's important to note that this mode affects only
124-
how JSON numbers are <code>decoded</code> to a CBOR object; it doesn't
124+
how JSON numbers are <i>decoded</i> to a CBOR object; it doesn't
125125
affect how <code>EncodeToBytes</code> and other methods encode CBOR
126126
objects. Notably, by default, <code>EncodeToBytes</code> encodes CBOR
127127
floating-point values to the CBOR format in their 16-bit

api/com.upokecenter.cbor.JSONOptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Includes options to control how CBOR objects are converted to JSON.
2525
class with default options.
2626
* `JSONOptions​(boolean base64Padding)`<br>
2727
Deprecated.
28-
Use the String constructor instead.
29-
Use the String constructor instead.
28+
Use the more readable String constructor instead.
29+
Use the more readable String constructor instead.
3030
* `JSONOptions​(boolean base64Padding,
3131
boolean replaceSurrogates)`<br>
3232
Deprecated.

api/com.upokecenter.cbor.PODOptions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ Options for controlling how certain DotNET or Java objects, such as
1515

1616
* `PODOptions() PODOptions`<br>
1717
Initializes a new instance of the PODOptions
18-
class.
18+
class with all the default options.
1919
* `PODOptions​(boolean removeIsPrefix,
20-
boolean useCamelCase) PODOptions`<br>
21-
Initializes a new instance of the PODOptions
22-
class.
20+
boolean useCamelCase)`<br>
21+
Deprecated.
22+
Use the more readable String constructor instead.
23+
Use the more readable String constructor instead.
2324
* `PODOptions​(java.lang.String paramString) PODOptions`<br>
2425
Initializes a new instance of the PODOptions
2526
class.

0 commit comments

Comments
 (0)