Class ArgParser
java.lang.Object
me.thiagorigonatti.capitalgains.util.ArgParser
Utility class responsible for parsing command-line arguments and applying them
to a
TaxCalculator instance.
Supports the following flags:
- -pel: Enables printing of the tax result for every line (Print Every Line).
- -t: Enables timing measurements for the execution.
- -bsi<size><unit>: Sets the input buffer size (e.g., -bsi512k, -bsi1m).
- -bso<size><unit>: Sets the output buffer size (e.g., -bso1m, -bso2g).
Accepted units for buffer size: k (kilobytes), m (megabytes),
g (gigabytes). The size must be a number from 1 to 999.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidparseArgs(String[] args, TaxCalculator taxCalculator) Parses the given command-line arguments and applies the corresponding configuration to the providedTaxCalculatorinstance.
-
Method Details
-
parseArgs
Parses the given command-line arguments and applies the corresponding configuration to the providedTaxCalculatorinstance.- Parameters:
args- the array of command-line argumentstaxCalculator- theTaxCalculatorto configure- Throws:
NumberFormatException- if a buffer size value exceedsInteger.MAX_VALUE
-