Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.0.0
-
None
-
None
Description
We represent unsigned integer types using the next larger sized signed integer. Ex: so xs:unsignedByte is represented by a Short, etc.
This works except for xs:unsignedLong. There is no next bigger type. Instead we use a BigInteger to represent an xs:unsignedLong.
All of that predates adding the ULong library to Daffodil. ULong behaves as an unsigned long, but represents itself as a signed long. This is much more efficient and generally a better idea than using BigInteger.
Similarly, we could use UInt, UShort and UByte as the representations of all the unsigned types for uniformity.
Direct support for these would need to be added to DataValue.
One thing to consider, and it may not matter, is that ULong and friends aren't subtypes of java.lang.Number, where all the other boxed number types we use are.
A search for java.lang.Number makes sense as a starting point. There are some places that use java.lang.Number specifically.