// 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;
package netvis.data;



/**
 * A helper function that creates classes which return a certain normalised
 * parameter of the packet
 */
public class NormaliseFactory {
	public static final NormaliseFactory INSTANCE = new NormaliseFactory();

	List<Normaliser> normalisers;

	private DataController dataController;

	private NormaliseFactory() {
		normalisers = new ArrayList<Normaliser>();
		normalisers.add(new SourceMACNorm());
		normalisers.add(new SourceIPNorm());
		normalisers.add(new SourcePortNorm());
		normalisers.add(new DestinationPortNorm());
		normalisers.add(new DestinationIPNorm());
		normalisers.add(new DestinationMACNorm());	
		normalisers.add(new ProtocolNorm());

	}

	public List<Normaliser> getNormalisers() {
		return normalisers;
	}
	public int getIndex(Normaliser n){
		return normalisers.lastIndexOf(n);
	}
	public Normaliser getNormaliser(int norm_id) {
		if (norm_id < normalisers.size())
			return normalisers.get(norm_id);
		else
			return null;
	}

	public abstract class Normaliser {
		double lowerBound = 0, upperBound = 1;
// 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;

package netvis.data;



/**
 * A helper function that creates classes which return a certain normalised
 * parameter of the packet
 */
public class NormaliseFactory {
	public static final NormaliseFactory INSTANCE = new NormaliseFactory();

	List<Normaliser> normalisers;

	private DataController dataController;

	private NormaliseFactory() {
		normalisers = new ArrayList<Normaliser>();
		normalisers.add(new SourceMACNorm());
		normalisers.add(new SourceIPNorm());
		normalisers.add(new SourcePortNorm());
		normalisers.add(new DestinationPortNorm());
		normalisers.add(new DestinationIPNorm());
		normalisers.add(new DestinationMACNorm());	
		normalisers.add(new ProtocolNorm());

	}

	public List<Normaliser> getNormalisers() {
		return normalisers;
	}
	public int getIndex(Normaliser n){
		return normalisers.lastIndexOf(n);
	}
	public Normaliser getNormaliser(int norm_id) {
		if (norm_id < normalisers.size())
			return normalisers.get(norm_id);
		else
			return null;
	}

	public abstract class Normaliser {
		double lowerBound = 0, upperBound = 1;
		NormalisationFilter myFilter = null;