Exclude extends GenericXMLEncodable implements XMLEncodable,
		Comparable<Exclude> { public void add(byte omissions[][] ) { if (omissions == null || omissions.length == 0) return; Arrays.sort(omissions, new ByteArrayCompare()); int i = 0, j = 0; byte [] omission; Element ee; Filler lastFiller = null; synchronized (_values) { for(;i<omissions.length && j<_values.size();) { omission = omissions[i]; ee = _values.get(j); if (ee instanceof ExcludeComponent) { ExcludeComponent ec = (ExcludeComponent) ee; int res = ec.compareTo(omission); if (res > 0) { if (lastFiller != null && lastFiller.match(omission)) { i++; continue; } _values.add(j, new ExcludeComponent(omission)); j++; if (lastFiller != null) { _values.add(j, lastFiller); j++; } i++; continue; } else if (res == 0) { i++; continue; } lastFiller = null; } else lastFiller = (Filler) ee; j++; } for(;i<omissions.length;i++) { omission = omissions[i]; _values.add(new ExcludeComponent(omission)); } } } Exclude(ArrayList<Element> values);  Exclude(byte omissions[][]);  Exclude(); static Exclude uptoFactory(byte [] component); static Exclude factory(byte omissions [][] ); boolean match(byte [] component); void add(byte omissions[][] ); void excludeUpto(byte [] component); boolean empty(); void decode(XMLDecoder decoder); void encode(XMLEncoder encoder); @Override long getElementLabel(); @Override boolean validate(); int compareTo(Exclude o); @Override boolean equals(Object obj); int hashCode(); int size(); Element value(int i); String toString(); static int OPTIMUM_FILTER_SIZE; }
@Test (expected=IllegalArgumentException.class) public void testExcludeArrayListOfElementFails() { Log.info(Log.FAC_TEST, "Starting testExcludeArrayListOfElementFails"); al.add(c06); al.add(c1); new Exclude(al); }
@Test (expected=IllegalArgumentException.class) public void testExcludeArrayListOfElementFails2() { Log.info(Log.FAC_TEST, "Starting testExcludeArrayListOfElementFails2"); al.add(c1); al.add(c06); al.add(bloom); al.add(any); new Exclude(al); }
@Test (expected=IllegalArgumentException.class) public void testExcludeArrayListOfElementFails3() { Log.info(Log.FAC_TEST, "Starting testExcludeArrayListOfElementFails3"); al.add(c1); al.add(any); al.add(bloom); al.add(c06); new Exclude(al); }
@Test public void testExcludeArrayListOfElement() { Log.info(Log.FAC_TEST, "Starting testExcludeArrayListOfElement"); al.add(c1); al.add(any); al.add(c3); al.add(c06); al.add(bloom); new Exclude(al); Log.info(Log.FAC_TEST, "Completed testExcludeArrayListOfElement"); }
@Test public void testAdd() { Log.info(Log.FAC_TEST, "Starting testAdd"); ef = Exclude.uptoFactory(b0); assertFalse(ef.match(b1)); ef.add(array); assertTrue(ef.match(b0)); assertTrue(ef.match(b1)); assertTrue(ef.match(b06)); Log.info(Log.FAC_TEST, "Completed testAdd"); }