Class PrintDayTotals
java.lang.Object
com.globalmentor.application.AbstractApplication
com.globalmentor.application.BaseCliApplication
com.globalmentor.calendar.calculator.PrintDayTotals
- All Implemented Interfaces:
com.globalmentor.application.Application,com.globalmentor.model.Named<String>,io.clogr.Clogged,Runnable
public class PrintDayTotals
extends com.globalmentor.application.BaseCliApplication
A console application to print the totals of days overlapping some ranges. This is useful, for example, in calculating the number of days in a country for
compliance with visa restrictions.
Ranges are in the form from,to, e.g.:
2010-01-02,2010-01-05
2010-03-10,2010-04-04
Output has five or six columns, depending on whether a maximum number of days was indicated:
positive-count-flag,date,count,run-total,window-total,difference, e.g.:
*,2013-02-18,1,1,136,44
*,2013-02-19,1,2,136,44
*,2013-02-20,,,135,45
If no historyCount is given, the value will default to windowSize.
Examples:
Print totals from 2010-02-04 to 2011-02-03 from the file ranges.txt:
PrintDayTotals 2011-02-03 365 < ranges.txt Print totals from 2010-02-04 to 2011-02-03 from the file
ranges.txt, indicating the difference of each from 180:PrintDayTotals 2011-02-03 365 180 < ranges.txt
- Author:
- Garret Wilson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhether a range bound should be included in the totals.Nested classes/interfaces inherited from class com.globalmentor.application.BaseCliApplication
com.globalmentor.application.BaseCliApplication.MetadataProvider -
Field Summary
Fields inherited from class com.globalmentor.application.BaseCliApplication
CONFIG_KEY_NAME, CONFIG_KEY_VERSION, DEFAULT_TERMINAL_WIDTHFields inherited from interface com.globalmentor.application.Application
EXIT_CODE_CONTINUE, EXIT_CODE_OK, EXIT_CODE_SOFTWARE, EXIT_CODE_USAGE, NO_ARGUMENTS -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.globalmentor.application.BaseCliApplication
cleanup, execute, getName, getVersion, initialize, isDebug, isQuiet, isVerbose, logAppInfo, onExit, reportError, reportError, reportError, setDebug, setQuiet, setTrace, setVerbose, updateLogLevelMethods inherited from class com.globalmentor.application.AbstractApplication
canEnd, canStart, end, exit, findShutdownDelay, getArgs, getAuthenticator, getExpirationDate, getPreferences, isShuttingDown, onShutdown, setAuthenticator, setExpirationDate, setShutdownDelay, start, toErrorMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.globalmentor.application.Application
endMethods inherited from interface io.clogr.Clogged
getLogger
-
Constructor Details
-
PrintDayTotals
Constructor.- Parameters:
args- The command line arguments.
-
-
Method Details