Adam Heath wrote:
If the internal representation was an array of ints, then we could have
int constants that are indexes into the array. Then we would need only
one accessor method:
Yeah, and array is what I was thinking too; however, it'll still take
up more memory than a single long representation. It really comes
down to which set of methods are called more often,
compare/hashCode/equals, or the field accessors.
Are you expecting to keep a lot of these in memory? You could also
create an array of shorts - that will accommodate a duration up to
32,000 years.