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

📄 load.java

📁 The WLAN Traffic Visualizer is a platform independent Java program providing accurate measurement of
💻 JAVA
字号:
package model;//Copyright (C) 2008 Harald Unander, Wang Wenjuan////    This file is part of WlanTV.////    WlanTV is free software: you can redistribute it and/or modify//    it under the terms of the GNU General Public License as published by//    the Free Software Foundation, either version 3 of the License, or//    (at your option) any later version.////    WlanTV is distributed in the hope that it will be useful,//    but WITHOUT ANY WARRANTY; without even the implied warranty of//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//    GNU General Public License for more details.////    You should have received a copy of the GNU General Public License//    along with WlanTV.  If not, see <http://www.gnu.org/licenses/>./>.public class Load {	public long[] realList = new long[LOAD_SECTION_COUNT];	public long[] extraList = new long[LOAD_SECTION_COUNT];	public double loadStep;	public long maxLoad = Integer.MIN_VALUE;	public long t0;	public long t1;	private static final int LOAD_SECTION_COUNT = 40;	private long span;	public Load(long t0,long t1) {		this.t0 = t0;		this.t1 = t1;		span = t1 - t0;		loadStep = ((double)span)/LOAD_SECTION_COUNT; 	}	public void addRealLoad(long pTime,int pLen) {		addLoad(realList,pTime,pLen);	}	public void addExtraLoad(long pTime,int pLen) {		addLoad(extraList,pTime,pLen);	}	private void addLoad(long[] list,long pTime,int pLen) {		if (pTime>=t0 && pTime<=t1) {			int index = (int)((pTime-t0)/loadStep);			if (index<0 || index>=LOAD_SECTION_COUNT) {//				Main.myLogging.addWarning(this,"addLoad oops index "+t0+" "+t1+" "+pTime+" "+index);			}			else {				list[index] += pLen;			}		}//		else//			Main.myLogging.addWarning(this,"addLoad oops pTime "+t0+" "+t1+" "+pTime);				}	public void calculate() {		for (int i=0; i<LOAD_SECTION_COUNT; i++) {			realList[i] = (long)(1E3*8*realList[i]/loadStep);			extraList[i] = (long)(1E3*8*extraList[i]/loadStep);			if (realList[i]+extraList[i] > maxLoad)				maxLoad = realList[i]+extraList[i];		}	}}

⌨️ 快捷键说明

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