/*
 Copyright (c) 1997 by Columbia University. All rights reserved.
 */
import java.util.*;

/** 
 * ChartData is a utility class created so we don't have to send 4 different
 * arrays to the GUI for graphing. It is used like a C/C++ structure.
 * It has publicly accessable arrays for 
 * avg delay times, packet loss, host names, and IP addresses. It also stores
 * the actually output for the traceroute program.
 * @version 1.0 31 Aug 1998
 * @author Terrence Truta
 */
public class ChartData {

		public String address;
		//parallel arrays to hold data to be graphed
		public int[] avg; 
		public String[] hostName;
		public String[] IPNum; 
		public int[] packetLoss;
		public int hops;
		public Vector trace_out; //vector to store the actual lines of output
														//of the tracert program
		public boolean pingData; //is ping data included
		public long time; //time of execution. Used for automation summary.

   /** Instantiates the public arrays and Vectors for the class */
	 ChartData() {
		 avg = new int[TracertWrapper.MAX_HOPS];
		 hostName = new String[TracertWrapper.MAX_HOPS];
		 IPNum = new String[TracertWrapper.MAX_HOPS];
		 packetLoss = new int[TracertWrapper.MAX_HOPS];
		 trace_out = new Vector();	 
	}
	
	/** Returns the length of the internal parallel arrays. This 
	  * number represents the amount of hops or hosts between the
		* local host and the choosen host
		*/
	public int getLength() {
		if (hostName != null) 
			return hops;
		else
			return 0;
	}

	/** Sets the address (host name) to which the data stored in this 
	 * object belongs.
	 */
	public void setAddress(String s) {
		address = s;
	}

	/** Returns the address (host name) to which the data stored in theis
	 * object belongs.
	 */
	public String getAddress() {
		return address;
	}

	/** Sets the time of in milliseconds (since Jan 1970) when the data
	 * in the object was created. <b>Not used currently.</b>
	 */
	public void setTime(long t) {
		time = t;
	}

	/** Returns the time of in milliseconds (since Jan 1970) when the data
	 * in the object was created. <b>Not used currently.</b>
	 */
	public long getTime() {
		return time;
	}

}