Code example for Vector

Methods: get

0
	 * Duration 
	 */ 
	public Double duration;
 
	public ListItem(Vector v) {
		appName = (String) v.get(0);
		packets = (Long) v.get(1);
		bytes = (Long) v.get(2);
		duration = (Double) v.get(3);
	} 
 
	public String nubmerToString(double num) {
		final int K = 1024;
		final int M = 1024 * 1024;
		final java.text.DecimalFormat df = new java.text.DecimalFormat("#.0");
		if (num > M) {
			return df.format(num * 1.0 / M) + "M";
		} else if (num > K) {
			return df.format(num * 1.0 / K) + "K";
		} 
		return "" + df.format(num);