Skip to content

Commit 98ad931

Browse files
committed
update Java version
1 parent 98b2c2f commit 98ad931

File tree

9 files changed

+265
-233
lines changed

9 files changed

+265
-233
lines changed

src/main/java/com/upokecenter/cbor/CBORTypeFilter.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ public final class CBORTypeFilter {
6767
* index is allowed under this type filter, otherwise, false.
6868
*/
6969
public boolean ArrayIndexAllowed(int index) {
70-
return (this.types & (1 << 4)) != 0 && index >= 0 && (this.anyArrayLength
71-
||
72-
((this.arrayMinLength || index < this.arrayLength) && index >=
70+
return (this.types & (1 << 4)) != 0 && index >= 0 && (this.anyArrayLength||
71+
((this.arrayMinLength || index < this.arrayLength) && index >=
7372
0));
7473
}
7574

@@ -117,9 +116,11 @@ public boolean ArrayLengthMatches(EInteger bigLength) {
117116
}
118117

119118
/**
120-
* Not documented yet.
121-
* @param index A 32-bit signed integer.
122-
* @return A CBORTypeFilter object.
119+
* Gets the type filter for this array filter by its index.
120+
* @param index A zero-based index of the filter to retrieve.
121+
* @return Returns None if the index is out of range, or Any if this filter
122+
* doesn't filter an array. Returns the appropriate filter for the array
123+
* index otherwise.
123124
*/
124125
public CBORTypeFilter GetSubFilter(int index) {
125126
if (this.anyArrayLength || this.any) {
@@ -144,9 +145,11 @@ public CBORTypeFilter GetSubFilter(int index) {
144145
}
145146

146147
/**
147-
* Not documented yet.
148-
* @param index A 64-bit signed integer.
149-
* @return A CBORTypeFilter object.
148+
* Gets the type filter for this array filter by its index.
149+
* @param index A zero-based index of the filter to retrieve.
150+
* @return Returns None if the index is out of range, or Any if this filter
151+
* doesn't filter an array. Returns the appropriate filter for the array
152+
* index otherwise.
150153
*/
151154
public CBORTypeFilter GetSubFilter(long index) {
152155
if (this.anyArrayLength || this.any) {

src/main/java/com/upokecenter/util/ExtendedDecimal.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public static ExtendedDecimal CreateNaN(
265265
}
266266

267267
/**
268-
* Creates a decimal number from a string that represents a number. See
268+
* Creates a decimal number from a text string that represents a number. See
269269
* <code>FromString(String, int, int, EContext)</code> for more information.
270270
* @param str A string that represents a number.
271271
* @return An arbitrary-precision decimal number with the same value as the
@@ -279,7 +279,7 @@ public static ExtendedDecimal FromString(String str) {
279279
}
280280

281281
/**
282-
* Creates a decimal number from a string that represents a number. See
282+
* Creates a decimal number from a text string that represents a number. See
283283
* <code>FromString(String, int, int, EContext)</code> for more information.
284284
* @param str A string that represents a number.
285285
* @param ctx A precision context to control precision, rounding, and exponent
@@ -306,7 +306,7 @@ public static ExtendedDecimal FromString(String str, PrecisionContext ctx) {
306306
}
307307

308308
/**
309-
* Creates a decimal number from a string that represents a number. See
309+
* Creates a decimal number from a text string that represents a number. See
310310
* <code>FromString(String, int, int, EContext)</code> for more information.
311311
* @param str A string that represents a number.
312312
* @param offset A zero-based index showing where the desired portion of {@code
@@ -329,7 +329,7 @@ public static ExtendedDecimal FromString(
329329
}
330330

331331
/**
332-
* <p>Creates a decimal number from a string that represents a number.</p>
332+
* <p>Creates a decimal number from a text string that represents a number.</p>
333333
* <p>The format of the string generally consists of:</p> <ul> <li>An
334334
* optional plus sign ("+" , U+002B) or minus sign ("-", U+002D) (if '-'
335335
* , the value is negative.)</li> <li>One or more digits, with a single

src/main/java/com/upokecenter/util/ExtendedRational.java

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
/**
1313
* <p><b>This class is largely obsolete. It will be replaced by a new version
1414
* of this class in a different namespace/package and library, called
15-
* <code>PeterO.Numbers.ERational</code> in the <code>PeterO.Numbers</code> library
16-
* (in .NET), or <code>com.upokecenter.numbers.getERational()</code> in the
17-
* <code>com.github.peteroupc/numbers</code> artifact (in Java). This new
18-
* class can be used in the <code>CBORObject.FromObject(Object)</code> method
19-
* (by including the new library in your code, among other things), but
20-
* this version of the CBOR library doesn't include any methods that
21-
* explicitly take an <code>ERational</code> as a parameter or return
15+
* <code>PeterO.Numbers.ERational</code> in the <a
16+
* href='https://www.nuget.org/packages/PeterO.Numbers'><code>PeterO.Numbers</code></a>
17+
* library (in .NET), or <code>com.upokecenter.numbers.ERational</code> in the
18+
* <a
19+
* href='https://github.com/peteroupc/numbers-java'><code>com.github.peteroupc/numbers</code></a>
20+
* artifact (in Java). This new class can be used in the
21+
* <code>CBORObject.FromObject(Object)</code> method (by including the new
22+
* library in your code, among other things), but this version of the
23+
* CBOR library doesn't include any methods that explicitly take an
24+
* <code>ERational</code> as a parameter or return
2225
* value.</b></p>Arbitrary-precision rational number. This class cannot
2326
* be inherited; this is a change in version 2.0 from previous versions,
2427
* where the class was inadvertently left inheritable. <p><b>Thread
@@ -112,7 +115,7 @@ public final BigInteger getDenominator() {
112115

113116
/**
114117
* Gets a value indicating whether this object is finite (not infinity or NaN).
115-
* @return True if this object is finite (not infinity or NaN); otherwise,
118+
* @return true if this object is finite (not infinity or NaN); otherwise,
116119
* false.
117120
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
118121
*/
@@ -124,15 +127,15 @@ public final boolean isFinite() {
124127
/**
125128
* Gets a value indicating whether this object's value is negative (including
126129
* negative zero).
127-
* @return True if this object's value is negative; otherwise, false.
130+
* @return true if this object's value is negative, otherwise, false.
128131
*/
129132
public final boolean isNegative() {
130133
return this.getEr().isNegative();
131134
}
132135

133136
/**
134137
* Gets a value indicating whether this object's value equals 0.
135-
* @return True if this object's value equals 0; otherwise, false.
138+
* @return true if this object's value equals 0, otherwise, false.
136139
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
137140
*/
138141
@Deprecated
@@ -290,7 +293,7 @@ public static ExtendedRational FromExtendedDecimal(ExtendedDecimal ef) {
290293
}
291294

292295
/**
293-
* Not documented yet.
296+
* Converts an arbitrary-precision binary float to a rational number.
294297
* @param ef An arbitrary-precision binary float.
295298
* @return An arbitrary-precision rational number.
296299
* @throws java.lang.NullPointerException The parameter {@code ef} is null.
@@ -305,7 +308,7 @@ public static ExtendedRational FromExtendedFloat(ExtendedFloat ef) {
305308
}
306309

307310
/**
308-
* Not documented yet.
311+
* Converts a 32-bit signed integer to a rational number.
309312
* @param smallint A 32-bit signed integer.
310313
* @return An arbitrary-precision rational number.
311314
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
@@ -316,7 +319,7 @@ public static ExtendedRational FromInt32(int smallint) {
316319
}
317320

318321
/**
319-
* Not documented yet.
322+
* Converts a 64-bit signed integer to a rational number.
320323
* @param longInt A 64-bit signed integer.
321324
* @return An arbitrary-precision rational number.
322325
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
@@ -435,17 +438,19 @@ public ExtendedRational Divide(ExtendedRational otherValue) {
435438
/**
436439
* Determines whether this object and another object are equal.
437440
* @param obj An arbitrary object.
438-
* @return True if the objects are equal; otherwise, false.
441+
* @return true if the objects are equal; otherwise, false.
439442
*/
440443
@Override public boolean equals(Object obj) {
441444
ExtendedRational bi = ((obj instanceof ExtendedRational) ? (ExtendedRational)obj : null);
442445
return (bi == null) ? false : this.getEr().equals(bi.getEr());
443446
}
444447

445448
/**
446-
* Not documented yet.
447-
* @param other An arbitrary-precision rational number.
448-
* @return A Boolean object.
449+
* Returns whether this object's properties are equal to the properties of
450+
* another rational number object.
451+
* @param other Another arbitrary-precision rational number.
452+
* @return true if this object's properties are equal to the properties of
453+
* another rational number object; otherwise, false.
449454
* @throws java.lang.NullPointerException The parameter {@code other} is null.
450455
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
451456
*/
@@ -467,7 +472,7 @@ public boolean equals(ExtendedRational other) {
467472

468473
/**
469474
* Gets a value indicating whether this object's value is infinity.
470-
* @return True if this object's value is infinity; otherwise, false.
475+
* @return true if this object's value is infinity, otherwise, false.
471476
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
472477
*/
473478
@Deprecated
@@ -477,15 +482,15 @@ public boolean IsInfinity() {
477482

478483
/**
479484
* Returns whether this object is a not-a-number value.
480-
* @return True if this object is a not-a-number value; otherwise, false.
485+
* @return true if this object is a not-a-number value, otherwise, false.
481486
*/
482487
public boolean IsNaN() {
483488
return this.getEr().IsNaN();
484489
}
485490

486491
/**
487492
* Returns whether this object is negative infinity.
488-
* @return True if this object is negative infinity; otherwise, false.
493+
* @return true if this object is negative infinity, otherwise, false.
489494
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
490495
*/
491496
@Deprecated
@@ -495,7 +500,7 @@ public boolean IsNegativeInfinity() {
495500

496501
/**
497502
* Returns whether this object is positive infinity.
498-
* @return True if this object is positive infinity; otherwise, false.
503+
* @return true if this object is positive infinity, otherwise, false.
499504
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
500505
*/
501506
@Deprecated
@@ -505,7 +510,7 @@ public boolean IsPositiveInfinity() {
505510

506511
/**
507512
* Returns whether this object is a quiet not-a-number value.
508-
* @return True if this object is a quiet not-a-number value; otherwise, false.
513+
* @return true if this object is a quiet not-a-number value; otherwise, false.
509514
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.
510515
*/
511516
@Deprecated
@@ -517,7 +522,7 @@ public boolean IsQuietNaN() {
517522
* Returns whether this object is a signaling not-a-number value (which causes
518523
* an error if the value is passed to any arithmetic operation in this
519524
* class).
520-
* @return True if this object is a signaling not-a-number value (which causes
525+
* @return true if this object is a signaling not-a-number value (which causes
521526
* an error if the value is passed to any arithmetic operation in this
522527
* class); otherwise, false.
523528
* @deprecated Use ERational from PeterO.Numbers/com.upokecenter.numbers.

0 commit comments

Comments
 (0)