Facsimile / facsimile

Facsimile Simulation Library
http://facsim.org/
GNU Lesser General Public License v3.0
27 stars 10 forks source link

Generic measurement range checking #13

Closed Facsimiler closed 5 years ago

Facsimiler commented 10 years ago

Currently, specific measurements have their ranges checked for validity, but generic measurements do not.

For example, Time values cannot be negative. Invoking Time.apply(-5) will result in an exception. However, if the same time quantity is stored as a Generic.Measure instance, then it can be negative without an exception being thrown upon creation. This is wrong: an exception should be thrown when the invalid Generic.Measure value is created.

One possible solution would be to have the Family class perform the range checking, so that there is no need for NonNegative physical quantities in the hierarchy.

Facsimiler commented 5 years ago

Closing, as no longer relevant.