Skip to content

Commit ee27ae4

Browse files
committed
Add toRadixString method to BigInteger
1 parent 67a0b83 commit ee27ae4

File tree

7 files changed

+801
-574
lines changed

7 files changed

+801
-574
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public static void AddTagHandler(BigInteger bigintTag, ICBORTag handler) {
263263
if (bigintTag.bitLength() > 64) {
264264
throw new IllegalArgumentException("bigintTag.bitLength (" +
265265
(long)bigintTag.bitLength() + ") is more than " +
266-
"64");
266+
"64");
267267
}
268268
synchronized (tagHandlers) {
269269
tagHandlers.put(bigintTag, handler);
@@ -505,7 +505,7 @@ public boolean IsNaN() {
505505
*/
506506
public int CompareToIgnoreTags(CBORObject other) {
507507
return (other == null) ? 1 : ((this == other) ? 0 :
508-
this.Untag().compareTo(other.Untag()));
508+
this.Untag().compareTo(other.Untag()));
509509
}
510510

511511
/**
@@ -586,7 +586,7 @@ public int compareTo(CBORObject other) {
586586
return 1;
587587
}
588588
cmp = (simpleValueA == simpleValueB) ? 0 : ((simpleValueA <
589-
simpleValueB) ? -1 : 1);
589+
simpleValueB) ? -1 : 1);
590590
} else if (typeA == typeB) {
591591
switch (typeA) {
592592
case CBORObjectTypeInteger: {
@@ -601,7 +601,7 @@ public int compareTo(CBORObject other) {
601601
// Treat NaN as greater than all other numbers
602602
cmp = Float.isNaN(a) ? (Float.isNaN(b) ? 0 : 1) :
603603
(Float.isNaN(b) ? (-1) : ((a == b) ? 0 : ((a < b) ? -1 :
604-
1)));
604+
1)));
605605
break;
606606
}
607607
case CBORObjectTypeBigInteger: {
@@ -616,7 +616,7 @@ public int compareTo(CBORObject other) {
616616
// Treat NaN as greater than all other numbers
617617
cmp = Double.isNaN(a) ? (Double.isNaN(b) ? 0 : 1) :
618618
(Double.isNaN(b) ? (-1) : ((a == b) ? 0 : ((a < b) ? -1 :
619-
1)));
619+
1)));
620620
break;
621621
}
622622
case CBORObjectTypeExtendedDecimal: {
@@ -1045,7 +1045,7 @@ public boolean equals(CBORObject other) {
10451045
valueHashCode += 651869479 * itemHashCode;
10461046
}
10471047
valueHashCode += 651869483 * (this.itemtypeValue +
1048-
this.tagLow + this.tagHigh);
1048+
this.tagLow + this.tagHigh);
10491049
}
10501050
return valueHashCode;
10511051
}
@@ -1372,7 +1372,7 @@ public byte[] GetByteString() {
13721372
public boolean HasTag(int tagValue) {
13731373
if (tagValue < 0) {
13741374
throw new IllegalArgumentException("tagValue (" + tagValue +
1375-
") is less than " + "0");
1375+
") is less than " + "0");
13761376
}
13771377
CBORObject obj = this;
13781378
while (true) {
@@ -3328,7 +3328,7 @@ public static CBORObject FromSimpleValue(int simpleValue) {
33283328
}
33293329
if (simpleValue >= 24 && simpleValue < 32) {
33303330
throw new IllegalArgumentException("Simple value is from 24 to 31: " +
3331-
simpleValue);
3331+
simpleValue);
33323332
}
33333333
if (simpleValue < 32) {
33343334
return valueFixedObjects[0xe0 + simpleValue];
@@ -3638,7 +3638,7 @@ public static <T> CBORObject FromObject(Iterable<T> value) {
36383638
* {@code dic} is null.
36393639
*/
36403640
public static <TKey, TValue> CBORObject FromObject(Map<TKey,
3641-
TValue> dic) {
3641+
TValue> dic) {
36423642
if (dic == null) {
36433643
return CBORObject.Null;
36443644
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public static String escapeURI(String s, int mode) {
188188
builder.append((char)c);
189189
} else if (c <= 0x10ffff) {
190190
builder.append((char)((((c - 0x10000) >> 10) & 0x3ff) +
191-
0xd800));
191+
0xd800));
192192
builder.append((char)(((c - 0x10000) & 0x3ff) + 0xdc00));
193193
}
194194
}
@@ -206,7 +206,7 @@ public static String escapeURI(String s, int mode) {
206206
builder.append((char)c);
207207
} else if (c <= 0x10ffff) {
208208
builder.append((char)((((c - 0x10000) >> 10) & 0x3ff) +
209-
0xd800));
209+
0xd800));
210210
builder.append((char)(((c - 0x10000) & 0x3ff) + 0xdc00));
211211
}
212212
} else {
@@ -232,7 +232,7 @@ public static String escapeURI(String s, int mode) {
232232
builder.append((char)c);
233233
} else if (c <= 0x10ffff) {
234234
builder.append((char)((((c - 0x10000) >> 10) & 0x3ff) +
235-
0xd800));
235+
0xd800));
236236
builder.append((char)(((c - 0x10000) & 0x3ff) + 0xdc00));
237237
}
238238
} else {

0 commit comments

Comments
 (0)