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 boolean
active
Active flagprotected int
countFrequency
Log count frequencyprotected DecimalFormat
decimalFormat
Decimal formatprotected int
localCount
Local count between logsprotected Date
localTime
Local time between logsprotected Integer
max
Max numberprotected int
progress
Total progressprotected int
timeFrequency
Log time frequency, stored in millisecondsprotected String
title
Log Titleprotected String
unit
Log Unit
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProgress(int progress)
void
cancel()
Cancel the operationboolean
cleanupOnCancel()
int
getCountFrequency()
Get the count frequencyInteger
getMax()
Get the maxprotected String
getPercentage(int count, int total)
Get the string percentage of the count and totalint
getProgress()
Get the total progressint
getTimeFrequency()
Get the time frequency in secondsboolean
isActive()
protected void
logProgress()
Log the progressvoid
setCountFrequency(int countFrequency)
Set the count frequencyvoid
setMax(int max)
void
setTimeFrequency(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:
setMax
in interfaceGeoPackageProgress
-
addProgress
public void addProgress(int progress)
- Specified by:
addProgress
in interfaceGeoPackageProgress
-
logProgress
protected void logProgress()
Log the progress
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceGeoPackageProgress
-
cleanupOnCancel
public boolean cleanupOnCancel()
- Specified by:
cleanupOnCancel
in 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
-
-