package loc.filter.filters.Aggregate;

import loc.filter.FilterSerializer;

import java.io.IOException;
import java.nio.file.Path;

public class FilterAnd extends AggregateFilter {
	public static final char prefix = '&';

	public static class Serializer implements FilterSerializer {
		@Override
		public FilterAnd parse(String string) throws Exception {
			String filterSequenceString = new loc.Parser(string)
					.skipSpaces()
					.skipChar(prefix)
					.skipSpaces()
					.openParenthesis()
					.getCurrentBufferString();
			return new FilterAnd(filters);
			Filter[] filters = new loc.Parser(filterSequenceString).parseSequence();
		}

		@Override
		public String serialize() throws Exception {
			return null;
		}
	}

	@Override
	public FilterSerializer getSerializer() {
		return new Serializer();
	}

	public FilterAnd(IFilter[] filters) {
        super(filters);
    }

	@Override
	public boolean check(Path file) throws IOException {
		for (Filter filter: filters) {
			if (!filter.check(file)) {
				return false;
			}
		}
		return true;
	}

	@Override
	public char getPrefix() {
		return prefix;
	}
}

@@ -67,16 +67,42 @@
 ializer;
+%0Aimport loc.filter.Filter;
 %0A%0Aimport
@@ -164,22 +164,16 @@
 c class 
-Filter
 And exte
@@ -318,22 +318,16 @@
 %09public 
-Filter
 And pars
@@ -539,42 +539,8 @@
 ();%0A
-%09%09%09return new FilterAnd(filters);%0A
 %09%09%09F
@@ -611,16 +611,44 @@
 ence();%0A
+%09%09%09return new And(filters);%0A
 %09%09%7D%0A%0A%09%09@
@@ -682,16 +682,29 @@
 rialize(
+Filter filter
 ) throws
@@ -731,11 +731,57 @@
 rn n
-ull
+ew AggregateFilter.Serializer().serialize(filter)
 ;%0A%09%09
@@ -883,19 +883,12 @@
 lic 
-Filter
 And(
-I
 Filt

Rename FilterAnd to And Fix method serialize(): - pass Filter argument - implement it's body. Change IFilter to Filter