summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/utils
AgeCommit message (Collapse)Author
2025-06-15Bump version number to 1.0.0v1.0.0Adrien Hopkins
2025-06-15Format & clean up source codeAdrien Hopkins
2025-06-15Revert expressionToRPN to package-privateAdrien Hopkins
This resolves the last remaining TODO/FIXME comment
2025-06-07Fix e-notation & consolidate expression parsingAdrien Hopkins
This commit moves all of the expression formatting code to one method, and changes it so that it works with things like '1e+2'. This does mean that I had to require spaces for addition and subtraction, but without that, the rules would be complicated.
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-30Throw error on expressions with too many operatorsAdrien Hopkins
2025-05-30ExpressionParser: use correct operand orderAdrien Hopkins
Most of the internal problems with the expression parser happened because I was accepting the arguments for binary operators in the wrong order. For example, '2 - 1' became '1 2 -', not '2 1 -'. The likely cause of this error is the following sequence of events: - In commit 6dbd32cd, I created the code for interpreting RPN. I accepted two arguments from the stack (o1 and o2), then performed o1 <op> o2. However, because stacks are in LIFO order, I should have actually done o2 <op> o1. - Later, in commit 94349688, I created the code for converting an infix expression to RPN. Creating the expressions in the correct order did not work, because my interpreter used the incorrect order. To 'fix' this problem, I created the expressions in the incorrect order. I did not notice any discrepancy, probably because I was not testing the individual methods, only the two-step whole (which found no errors).
2025-05-17Setup automated javadocAdrien Hopkins
./gradlew javadoc
2025-03-21Add tests for NameSymbolAdrien Hopkins
2024-08-22Allow fractional exponentsAdrien Hopkins
2024-08-15Correct encoding of ±Adrien Hopkins
2024-03-24Format source code & set explicit UTF-8Adrien Hopkins
2024-03-23Complete exponentiation of dimensionsAdrien Hopkins
Previously, you could only exponentiate individual dimensions in expressions. For example, `Length^3` was valid, but `(Length / Time)^2` was not. This is now fixed.
2022-07-08Bumped version number to 0.4.0b1 & added @sincev0.4.0b1Adrien Hopkins
2022-05-18Added front-end code information to the design documentAdrien Hopkins
2022-04-19Implemented prefix settings, saving & loading of settingsAdrien Hopkins
Also fixed some bugs: - Presenter now has default values for its settings in case they don't load properly - UnitDatabase ensures its units, prefixes and dimensions have all of the names you give it
2022-04-18Implemented rounding and duplicate-removal settings into the new GUIAdrien Hopkins
2022-04-16Implemented the unit & prefix viewersAdrien Hopkins
2022-04-16Removed NamedObjectProduct in favour of the regular ObjectProductAdrien Hopkins
2022-03-10Named the metric dimensions & fixed NameSymbol.toStringAdrien Hopkins
2022-03-10Simplified toString of common unit classesAdrien Hopkins
2022-02-26Implemented expression conversion, tests now passAdrien 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
2022-02-24Moved SemanticVersionNumber to sevenUnits.utilsAdrien Hopkins
2021-12-16Designed the API for a new GUIAdrien Hopkins
Currently "supports" unit conversion, expression conversion and settings loading
2021-11-29Added a full suite of tests for the UncertainDoubleAdrien Hopkins
2021-11-04Added a bunch of tests related to unit valuesAdrien Hopkins
2021-10-07Added tests for getUnit and the prefixed unit mapAdrien Hopkins
Also fixed a bug where a prefixed unit map with units but no prefixes would appear empty
2021-09-27The ExpressionParser test is now a paramaterized testAdrien Hopkins
2021-09-27Added some tests for invalid unitfilesAdrien Hopkins
2021-08-07Renamed sevenUnits.math to sevenUnits.utilsAdrien Hopkins