private boolean updateAddressFilter(String filter)
	{
		String[] pieces = filter.split("/");
		if(pieces.length != 2)
		{
			searchTextField.setBackground(Color.RED);
			return false;
		}
		InetAddress new_filter_address;
		InetAddress new_filter_mask;
		boolean new_filter_enabled = !(pieces[1].equals("0"));
		try {
			new_filter_address = InetAddress.getByName(pieces[0]);
			// compute the subnet mask address
			byte[] byte_mask = new byte[4];
			int slash = Integer.parseInt(pieces[1]);
			// compute the mask address 
			// there is probably a way easier way to do this
			for (int j=0; slash-- > 0; j++) {
				if (j<8)  byte_mask[0] += Math.pow(2,j);
				if (j<16) byte_mask[1] += Math.pow(2,j-8);
				if (j<24) byte_mask[2] += Math.pow(2,j-16);
				if (j<32) byte_mask[3] += Math.pow(2,j-24);
			}
			new_filter_mask = InetAddress.getByAddress(byte_mask);
		}
		catch (Exception e) {
			searchTextField.setBackground(Color.RED);
			return false;
		}
		ip_filter_enabled = new_filter_enabled;
		filter_address = new_filter_address;
		filter_mask = new_filter_mask;
		fireExpressionChangedEvent();
		//TODO: make data listen to this so that we don't need this call
		data.setFilterPredicate(this);
		System.out.println("Updating filter succeeded!");
		searchTextField.setBackground(Color.WHITE);
		return true;
	}
private boolean updateAddressFilter(String filter)
	{
		String[] pieces = filter.split("/");
		if(pieces.length != 2)
		{
			searchTextField.setBackground(Color.RED);
			return false;
		}
		InetAddress new_filter_address;
		InetAddress new_filter_mask;
		boolean new_filter_enabled = !(pieces[1].equals("0"));
		try {
			new_filter_address = InetAddress.getByName(pieces[0]);
		
			byte[] byte_mask = new byte[4];
			int slash = Integer.parseInt(pieces[1]);
		
		
			for (int j=0; slash-- > 0; j++) {
				if (j<8)  byte_mask[0] += Math.pow(2,j);
				if (j<16) byte_mask[1] += Math.pow(2,j-8);
				if (j<24) byte_mask[2] += Math.pow(2,j-16);
				if (j<32) byte_mask[3] += Math.pow(2,j-24);
			}
			new_filter_mask = InetAddress.getByAddress(byte_mask);
		}
		catch (Exception e) {
			searchTextField.setBackground(Color.RED);
			return false;
		}
		ip_filter_enabled = new_filter_enabled;
		filter_address = new_filter_address;
		filter_mask = new_filter_mask;
		fireExpressionChangedEvent();
	
		data.setFilterPredicate(this);
		System.out.println("Updating filter succeeded!");
		searchTextField.setBackground(Color.WHITE);
		return true;
	}
private boolean updateaddressfilter(string filter) { string[] pieces = filter.split("/"); if(pieces.length != 2) { searchtextfield.setbackground(color.red); return false; } inetaddress new_filter_address; inetaddress new_filter_mask; boolean new_filter_enabled = !(pieces[1].equals("0")); try { new_filter_address = inetaddress.getbyname(pieces[0]); byte[] byte_mask = new byte[4]; int slash = integer.parseint(pieces[1]); for (int j=0; slash-- > 0; j++) { if (j<8) byte_mask[0] += math.pow(2,j); if (j<16) byte_mask[1] += math.pow(2,j-8); if (j<24) byte_mask[2] += math.pow(2,j-16); if (j<32) byte_mask[3] += math.pow(2,j-24); } new_filter_mask = inetaddress.getbyaddress(byte_mask); } catch (exception e) { searchtextfield.setbackground(color.red); return false; } ip_filter_enabled = new_filter_enabled; filter_address = new_filter_address; filter_mask = new_filter_mask; fireexpressionchangedevent(); data.setfilterpredicate(this); system.out.println("updating filter succeeded!"); searchtextfield.setbackground(color.white); return true; }