Package mil.nga.geopackage.io
Class Progress
- java.lang.Object
-
- mil.nga.geopackage.io.Progress
-
- All Implemented Interfaces:
GeoPackageProgress
- Direct Known Subclasses:
ZoomLevelProgress
public class Progress extends Object implements GeoPackageProgress
Progress logger- Since:
- 3.3.0
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveActive flagprotected intcountFrequencyLog count frequencyprotected DecimalFormatdecimalFormatDecimal formatprotected intlocalCountLocal count between logsprotected DatelocalTimeLocal time between logsprotected IntegermaxMax numberprotected intprogressTotal progressprotected inttimeFrequencyLog time frequency, stored in millisecondsprotected StringtitleLog Titleprotected StringunitLog Unit
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProgress(int progress)voidcancel()Cancel the operationbooleancleanupOnCancel()intgetCountFrequency()Get the count frequencyIntegergetMax()Get the maxprotected StringgetPercentage(int count, int total)Get the string percentage of the count and totalintgetProgress()Get the total progressintgetTimeFrequency()Get the time frequency in secondsbooleanisActive()protected voidlogProgress()Log the progressvoidsetCountFrequency(int countFrequency)Set the count frequencyvoidsetMax(int max)voidsetTimeFrequency(int timeFrequency)Set the time frequency in seconds
-
-
-
Field Detail
-
decimalFormat
protected DecimalFormat decimalFormat
Decimal format
-
max
protected Integer max
Max number
-
progress
protected int progress
Total progress
-
active
protected boolean active
Active flag
-
title
protected final String title
Log Title
-
unit
protected final String unit
Log Unit
-
countFrequency
protected int countFrequency
Log count frequency
-
timeFrequency
protected int timeFrequency
Log time frequency, stored in milliseconds
-
localCount
protected int localCount
Local count between logs
-
localTime
protected Date localTime
Local time between logs
-
-
Constructor Detail
-
Progress
public Progress(String title, int countFrequency, int timeFrequency)
Constructor- Parameters:
title- titlecountFrequency- count frequencytimeFrequency- time frequency in seconds
-
-
Method Detail
-
setMax
public void setMax(int max)
- Specified by:
setMaxin interfaceGeoPackageProgress
-
addProgress
public void addProgress(int progress)
- Specified by:
addProgressin interfaceGeoPackageProgress
-
logProgress
protected void logProgress()
Log the progress
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceGeoPackageProgress
-
cleanupOnCancel
public boolean cleanupOnCancel()
- Specified by:
cleanupOnCancelin interfaceGeoPackageProgress
-
cancel
public void cancel()
Cancel the operation
-
getMax
public Integer getMax()
Get the max- Returns:
- max
-
getCountFrequency
public int getCountFrequency()
Get the count frequency- Returns:
- count frequency
- Since:
- 3.5.0
-
setCountFrequency
public void setCountFrequency(int countFrequency)
Set the count frequency- Parameters:
countFrequency- count frequency- Since:
- 3.5.0
-
getTimeFrequency
public int getTimeFrequency()
Get the time frequency in seconds- Returns:
- time frequency in seconds
- Since:
- 3.5.0
-
setTimeFrequency
public void setTimeFrequency(int timeFrequency)
Set the time frequency in seconds- Parameters:
timeFrequency- time frequency in seconds- Since:
- 3.5.0
-
getProgress
public int getProgress()
Get the total progress- Returns:
- progress
-
getPercentage
protected String getPercentage(int count, int total)
Get the string percentage of the count and total- Parameters:
count- current counttotal- total count- Returns:
- string percentage
-
-