// Path: app/src/main/java/siteswaplib/NumberFilter.java
// public enum Type {GREATER_EQUAL, SMALLER_EQUAL, EQUAL}


import siteswaplib.NumberFilter.Type;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
/*
* Siteswap Generator: Android App for generating juggling siteswaps
* Copyright (C) 2017 Tilman Sinning
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package siteswaplib;



public class FilterList extends LinkedList<Filter> implements Serializable {

	public FilterList() {
	}


	public FilterList(int numberOfJugglers, int numberOfSynchronousHands) {
		addDefaultFilters(numberOfJugglers, numberOfSynchronousHands);
	}

    // TODO add and use method updateNumberOfJugglersAndSynchronousHands

	public void addDefaultFilters(int numberOfJugglers, int minThrow,
										 int numberOfSynchronousHands) {
		if (numberOfJugglers <= 1)
			return;

		// remove Filters first, to avoid duplicate filters
		removeDefaultFilters(numberOfJugglers, minThrow, numberOfSynchronousHands);
// Path: app/src/main/java/siteswaplib/NumberFilter.java
// public enum Type {GREATER_EQUAL, SMALLER_EQUAL, EQUAL}


// Path: app/src/main/java/siteswaplib/FilterList.java
import siteswaplib.NumberFilter.Type;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

/*
* Siteswap Generator: Android App for generating juggling siteswaps
* Copyright (C) 2017 Tilman Sinning
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package siteswaplib;



public class FilterList extends LinkedList<Filter> implements Serializable {

	public FilterList() {
	}


	public FilterList(int numberOfJugglers, int numberOfSynchronousHands) {
		addDefaultFilters(numberOfJugglers, numberOfSynchronousHands);
	}

    // TODO add and use method updateNumberOfJugglersAndSynchronousHands

	public void addDefaultFilters(int numberOfJugglers, int minThrow,
										 int numberOfSynchronousHands) {
		if (numberOfJugglers <= 1)
			return;

		// remove Filters first, to avoid duplicate filters
		removeDefaultFilters(numberOfJugglers, minThrow, numberOfSynchronousHands);
		addFirst(new NumberFilter(Siteswap.PASS, Type.GREATER_EQUAL, 1, numberOfSynchronousHands));