// Path: workspace/netvis/src/netvis/data/filters/NormalisationFilter.java
// public class NormalisationFilter extends FixedFilter{
// 
// 	private final Normaliser norm;
// 	public NormalisationFilter(Normaliser norm){
// 		super("<html>" + norm.name() + ":<br>" + 
// 				String.valueOf(norm.denormalise(0)) + "-" +
// 				String.valueOf(norm.denormalise(1))+ "</html>");
// 
// 		this.norm = norm;
// 	}
// 	@Override
// 	public boolean filter(Packet packet) {
// 		double v = norm.normalise(packet);
// 		return (v <= 1 && v >= 0);
// 	}
// 	@Override
// 	protected void clearFilter() {
// 		this.norm.clearFilter();
// 	}
// }
// 
// Path: workspace/netvis/src/netvis/data/model/Packet.java
// public class Packet {
// 	public final int no, sport, dport, length;
// 	public final double time;
// 	public final String smac, dmac, info, protocol, sip, dip;
// 
// 	/**
// 	 * 
// 	 * @param no
// 	 *            Packet number
// 	 * @param time
// 	 *            Time elapsed since first packet (seconds)
// 	 * @param sip
// 	 *            Source IPv4/6 address
// 	 * @param smac
// 	 *            Source hardware (MAC) address
// 	 * @param sport
// 	 *            Source Port
// 	 * @param dip
// 	 *            Destination IPv4/6 address
// 	 * @param dmac
// 	 *            Destination hardware (MAC) address
// 	 * @param dport
// 	 *            Destination Port
// 	 * @param protocol
// 	 *            Communication protocol
// 	 * @param length
// 	 *            Packet Length(Bytes)
// 	 * @param info
// 	 *            Detected description of packet purpose
// 	 */
// 	public Packet(int no, double time, String sip, String smac, int sport, String dip, String dmac,
// 			int dport, String protocol, int length, String info) {
// 		this.no = no;
// 		this.time = time;
// 		this.sip = sip;
// 		this.smac = smac;
// 		this.sport = sport;
// 		this.dip = dip;
// 		this.dmac = dmac;
// 		this.dport = dport;
// 		this.protocol = protocol;
// 		this.length = length;
// 		this.info = info;
// 	}
// 
// }


import java.util.ArrayList;
import java.util.List;
import netvis.data.filters.NormalisationFilter;
import netvis.data.model.Packet;
			return null;
	}

	public abstract class Normaliser {
		double lowerBound = 0, upperBound = 1;
		NormalisationFilter myFilter = null;
		protected abstract double normaliseFunction(Packet p);
		protected abstract String denormaliseFunction (double v);
		public abstract String name();
		public double normalise(Packet p){
			double v = this.normaliseFunction(p);
			v = (v - lowerBound)/(upperBound - lowerBound);
			//System.out.println(lowerBound);
			//System.out.println(v);
	
			return v;
		}
		public String denormalise(double v){
			v = v * (upperBound - lowerBound);
			v += lowerBound;
			return denormaliseFunction(v);
		}
		public void filter(double lowerBound, double upperBound){		
			double interval = this.upperBound - this.lowerBound;
			this.upperBound = this.lowerBound + upperBound*interval;
				if (this.upperBound > 1) this.upperBound = 1;
			this.lowerBound += lowerBound*interval;
				if (this.lowerBound < 0) this.lowerBound = 0;
			if (myFilter != null)
				dataController.removeFilter(myFilter);
// Path: workspace/netvis/src/netvis/data/filters/NormalisationFilter.java
// public class NormalisationFilter extends FixedFilter{
// 
// 	private final Normaliser norm;
// 	public NormalisationFilter(Normaliser norm){
// 		super("<html>" + norm.name() + ":<br>" + 
// 				String.valueOf(norm.denormalise(0)) + "-" +
// 				String.valueOf(norm.denormalise(1))+ "</html>");
// 
// 		this.norm = norm;
// 	}
// 	@Override
// 	public boolean filter(Packet packet) {
// 		double v = norm.normalise(packet);
// 		return (v <= 1 && v >= 0);
// 	}
// 	@Override
// 	protected void clearFilter() {
// 		this.norm.clearFilter();
// 	}
// }
// 
// Path: workspace/netvis/src/netvis/data/model/Packet.java
// public class Packet {
// 	public final int no, sport, dport, length;
// 	public final double time;
// 	public final String smac, dmac, info, protocol, sip, dip;
// 
// 	/**
// 	 * 
// 	 * @param no
// 	 *            Packet number
// 	 * @param time
// 	 *            Time elapsed since first packet (seconds)
// 	 * @param sip
// 	 *            Source IPv4/6 address
// 	 * @param smac
// 	 *            Source hardware (MAC) address
// 	 * @param sport
// 	 *            Source Port
// 	 * @param dip
// 	 *            Destination IPv4/6 address
// 	 * @param dmac
// 	 *            Destination hardware (MAC) address
// 	 * @param dport
// 	 *            Destination Port
// 	 * @param protocol
// 	 *            Communication protocol
// 	 * @param length
// 	 *            Packet Length(Bytes)
// 	 * @param info
// 	 *            Detected description of packet purpose
// 	 */
// 	public Packet(int no, double time, String sip, String smac, int sport, String dip, String dmac,
// 			int dport, String protocol, int length, String info) {
// 		this.no = no;
// 		this.time = time;
// 		this.sip = sip;
// 		this.smac = smac;
// 		this.sport = sport;
// 		this.dip = dip;
// 		this.dmac = dmac;
// 		this.dport = dport;
// 		this.protocol = protocol;
// 		this.length = length;
// 		this.info = info;
// 	}
// 
// }


// Path: workspace/netvis/src/netvis/data/NormaliseFactory.java
import java.util.ArrayList;
import java.util.List;
import netvis.data.filters.NormalisationFilter;
import netvis.data.model.Packet;

			return null;
	}

	public abstract class Normaliser {
		double lowerBound = 0, upperBound = 1;
		NormalisationFilter myFilter = null;
		protected abstract double normaliseFunction(Packet p);
		protected abstract String denormaliseFunction (double v);
		public abstract String name();
		public double normalise(Packet p){
			double v = this.normaliseFunction(p);
			v = (v - lowerBound)/(upperBound - lowerBound);
			//System.out.println(lowerBound);
			//System.out.println(v);
	
			return v;
		}
		public String denormalise(double v){
			v = v * (upperBound - lowerBound);
			v += lowerBound;
			return denormaliseFunction(v);
		}
		public void filter(double lowerBound, double upperBound){		
			double interval = this.upperBound - this.lowerBound;
			this.upperBound = this.lowerBound + upperBound*interval;
				if (this.upperBound > 1) this.upperBound = 1;
			this.lowerBound += lowerBound*interval;
				if (this.lowerBound < 0) this.lowerBound = 0;
			if (myFilter != null)
				dataController.removeFilter(myFilter);
			myFilter = new NormalisationFilter(this);