-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
To make the interface independent of our FileAddress object, we should return a number value instead of the object itself to allow other implementations to get rid of our abstraction. There are two possibilities:
- Return a
long. This will allow to seek directly a file by using the returned value, and it will enforce a maximum value for the implementations. We are not planning to support pointers larger than a long yet (I have to think how that can be done). - Return a
Number. Like that, some implementations can useBigIntegeror their own number implementation: e.g., ourFileAddresscan extendNumberto be used directly. In this case, we should point in our javadoc that the number will be converted tolongfor being seek, so arithmetic exceptions should be considered.
I prefer the first point, because like that all the enforcing is implementation-dependent. Something similar will be done with the object sizes.