Package sun.net
Class ProgressMonitor
- java.lang.Object
-
- sun.net.ProgressMonitor
-
public class ProgressMonitor extends Object
ProgressMonitor is a class for monitoring progress in network input stream.
-
-
Constructor Summary
Constructors Constructor Description ProgressMonitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProgressListener(ProgressListener l)Add progress listener in progress monitor.static ProgressMonitorgetDefault()Return default ProgressMonitor.ArrayList<ProgressSource>getProgressSources()Return a snapshot of the ProgressSource listintgetProgressUpdateThreshold()Return update notification thresholdvoidregisterSource(ProgressSource pi)Register progress source when progress is began.voidremoveProgressListener(ProgressListener l)Remove progress listener from progress monitor.static voidsetDefault(ProgressMonitor m)Change default ProgressMonitor implementation.static voidsetMeteringPolicy(ProgressMeteringPolicy policy)Change progress metering policy.booleanshouldMeterInput(URL url, String method)Return true if metering should be turned on for a particular URL input stream.voidunregisterSource(ProgressSource pi)Unregister progress source when progress is finished.voidupdateProgress(ProgressSource pi)Progress source is updated.
-
-
-
Method Detail
-
getDefault
public static ProgressMonitor getDefault()
Return default ProgressMonitor.
-
setDefault
public static void setDefault(@Nullable ProgressMonitor m)
Change default ProgressMonitor implementation.
-
setMeteringPolicy
public static void setMeteringPolicy(@Nullable ProgressMeteringPolicy policy)
Change progress metering policy.
-
getProgressSources
public ArrayList<ProgressSource> getProgressSources()
Return a snapshot of the ProgressSource list
-
getProgressUpdateThreshold
public int getProgressUpdateThreshold()
Return update notification threshold
-
shouldMeterInput
public boolean shouldMeterInput(URL url, String method)
Return true if metering should be turned on for a particular URL input stream.
-
registerSource
public void registerSource(ProgressSource pi)
Register progress source when progress is began.
-
unregisterSource
public void unregisterSource(ProgressSource pi)
Unregister progress source when progress is finished.
-
updateProgress
public void updateProgress(ProgressSource pi)
Progress source is updated.
-
addProgressListener
public void addProgressListener(ProgressListener l)
Add progress listener in progress monitor.
-
removeProgressListener
public void removeProgressListener(ProgressListener l)
Remove progress listener from progress monitor.
-
-