summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/unit/LinearUnit.java
AgeCommit message (Collapse)Author
2025-06-04Add version numbers to all @since tagsAdrien Hopkins
Specifically, for every @since tag with a date, I added another that contains the correspending version. I did not add date @since tags to comments that do not have them, as that would be too tedious for what it's worth. These dates could still be found by using git bisect though.
2025-06-04Update copyright notices' yearsAdrien Hopkins
I used the Git history for years after 2019, and only included 2019 or 2018 if they were already there. I also added copyright notices to all code files that don't already have them.
2025-06-04Remove most comment warningsAdrien Hopkins
In some cases I've used @SuppressWarnings, which Gradle doesn't seem to respect, but I've solved all the other ones.
2025-05-30Ensure LinearUnit&Prefix ==/hash obey contractsAdrien Hopkins
Previously, these classes' equals() and hashCode() methods did not obey the contracts: For equals(), I considered two values equal even if there was a very small deviation, in order to avoid floating-point error. This equals relation is not transitive (i.e. it is possible that a = b && b = c but a ≠ c), violating the contract of equals. This also makes it impossible to properly implement hashCode, as if two values are equal, they must have the same hash code. The solution I had provided is an ineffective hack, which could mess with hash maps and sets. I have changed the implementation to demand exact equality. I have also provided equalsApproximately() methods to both classes that use the old behaviour. Hash codes are only really used for hash maps, and the old implementation doesn't even achieve its purpose, so I did not add a method to return the old hash behaviour.
2025-05-30Remove Unitlike/MultiUnitAdrien Hopkins
I ended up never using this code - it was simpler to just use lists of units and values. Making a whole new object for lists of units, and an abstract class for things that convert things other than doubles, is needlessly complicated, and doesn't solve any major issues. For example, I still need to store each Unitlike type in a different collection, because it will have a different type.
2024-08-22Allow fractional exponentsAdrien Hopkins
2024-03-24Format source code & set explicit UTF-8Adrien Hopkins
2022-04-16Implemented the unit & prefix viewersAdrien Hopkins
2022-03-10Simplified toString of common unit classesAdrien Hopkins
2022-02-26Implemented unit conversion, with a few problemsAdrien Hopkins
TabbedView now displays its units, but with their toString method which shows their definition in addition to their name
2021-08-07Renamed sevenUnits.math to sevenUnits.utilsAdrien Hopkins
2021-06-28Renamed project to 7UnitsAdrien Hopkins