⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 progressdata.java

📁 本程序在Unix_Linux环境下用Java语言编写的文件下载程序
💻 JAVA
字号:
package loader.data;/** * * @author juddy */public class ProgressData {    public int MIN;    public int MAX;        private int currentLength;    /**     * the following methods including constructors is used to constructe the object.     * must min <= cur_len <= max     */    public ProgressData( int min, int max, int cur_len ){        MIN = min;        MAX = max;                this.currentLength = cur_len;    }        public ProgressData( int min, int max ){        this( min, max, 0 );    }        public ProgressData(){        MIN = 0;        MAX = 0;        this.currentLength = 0;    }    /**     * when getting MIN, MAX , you just through ProgressData.MIN or ProgressData.MAX     */    public void setMin( int min ){        MIN = min;    }        public void setMax( int max ){        MAX = max;    }    /**     * when the other thread be updating the currentLength's value,      * this thread must be blocked to wait.     */    synchronized public int getCurrentLength(){        return this.currentLength;    }    /**     * when the other thread be getting the currentLength's value,     * this thread must be blocked to wait.     */    synchronized public void setCurrentLength( int inc_value ){        if( this.currentLength < MAX ){            this.currentLength += inc_value;        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -