Creates a filter from the list of the children filter elements.

@return the filter instance
766813
public Filter toFilter() {
        Filter[] result = new Filter[filters.size()];
        for (int i = 0; i < result.length; i++) {
            result[i] = filters.get(i).createFilter();
        }
        return chain(result);
    }
646720
public static Resource[] listResources(Resource[] resources, ResourceFilter filter) {
	int count = 0;
	Resource[] children;
	ArrayList<Resource[]> list = new ArrayList<Resource[]>();
	for (int i = 0; i < resources.length; i++) {
	    children = filter == null ? resources[i].listResources() : resources[i].listResources(filter);
	    if (children != null) {
		count += children.length;
		list.add(children);
	    }
	    else list.add(new Resource[0]);
	}
	Resource[] rtn = new Resource[count];
	int index = 0;
	for (int i = 0; i < resources.length; i++) {
	    children = list.get(i);
	    for (int y = 0; y < children.length; y++) {
		rtn[index++] = children[y];
	    }
	}
	// print.out(rtn);
	return rtn;
    }
628487
protected List<Element> filterChildren(Element parent, String tagName)
    {
        List<Element> result = new ArrayList<Element>();
        Node current = parent.getFirstChild();
        while (current != null) {
            if (current.getNodeName().equals(tagName)) {
                result.add((Element) current);
            }
            current = current.getNextSibling();
        }
        return result;
    }
289829
public Filter createFilter(FilterFactoryParams params) throws FilterNotCreatedException {
        try {
            return createFilter(parseCategories(params.getArgs()));
        } catch (ClassNotFoundException e) {
            throw new FilterNotCreatedException(e);
        }
    }
1127927
protected final Iterator<Page> listChildren(Resource parentResource, PageFilter pageFilter) {
    return new PageIterator(parentResource.listChildren(), pageFilter);
  }
772735
public Iterator getFilterIterator()
    {
        if (m_filter instanceof Map)
            return ((Map)m_filter).values().iterator();
        else if (m_filter != null)
            return new OneFilterIterator();
        else
            return null;    // Okay
    }
929573
public static <T> T[] filter(T[] array, Filter<T> filter) {
		if(null == filter) {
			return array;
		}
		
		final ArrayList<T> list = new ArrayList<T>(array.length);
		for (T t : array) {
			if (filter.accept(t)) {
				list.add(t);
			}
		}
		final T[] result = newArray(array.getClass().getComponentType(), list.size());
		return list.toArray(result);
	}
124266
public MongoDeepJobConfig<T> filterQuery(Filter[] filters) {

        if (filters.length > 0) {
            List<BasicDBObject> list = new ArrayList<>();

            QueryBuilder queryBuilder = QueryBuilder.start();
            for (int i = 0; i < filters.length; i++) {
                BasicDBObject bsonObject = new BasicDBObject();

                Filter filter = filters[i];
                if (filter.getFilterType().equals(FilterType.EQ)) {
                    bsonObject.put(filter.getField(), filter.getValue());
                } else {
                    bsonObject.put(filter.getField(),
                            new BasicDBObject("$".concat(filter.getFilterType().getFilterTypeId().toLowerCase()),
                                    filter.getValue()));
                }

                list.add(bsonObject);
            }
            queryBuilder.and(list.toArray(new BasicDBObject[list.size()]));

            filterQuery(queryBuilder);
        }
        return this;

    }
639733
public FilterMappingType<PortletDescriptor> getOrCreateFilterMapping()
   {
      List<Node> nodeList = model.get("filter-mapping");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FilterMappingTypeImpl<PortletDescriptor>(this, "filter-mapping", model, nodeList.get(0));
      }
      return createFilterMapping();
   }
449608
public static List<Element> getChildElements(Element e) {

		List<Element> ret = new ArrayList<Element>();
		NodeList children = e.getChildNodes();

		for (int i = 0; i < children.getLength(); i++) {
			Node child = children.item(i);
			if (child.getNodeType()  == Node.ELEMENT_NODE) {
				ret.add((Element) child);
			}
		}

		return ret;
	}
24070
public List<FilterType<PortletDescriptor>> getAllFilter()
   {
      List<FilterType<PortletDescriptor>> list = new ArrayList<FilterType<PortletDescriptor>>();
      List<Node> nodeList = model.get("filter");
      for(Node node: nodeList)
      {
         FilterType<PortletDescriptor>  type = new FilterTypeImpl<PortletDescriptor>(this, "filter", model, node);
         list.add(type);
      }
      return list;
   }
1353457
private Filter createFilter() {
    return new FilterList(FilterList.Operator.MUST_PASS_ONE, processedStateFilter, new SingleColumnValueFilter(
      QueueEntryRow.COLUMN_FAMILY, stateColumnName, CompareFilter.CompareOp.GREATER,
      new BinaryPrefixComparator(Bytes.toBytes(transaction.getReadPointer()))
    ));
  }
1051124
def getElements(self, filter):
		
		l = reduce(lambda l, e: l + e.getElements(filter), self.childNodes, [])
		if filter(self):
			l.append(self)
		return l
481174
public TreeElement[] getChildren()
    {
        if (_children == null)
            return EMPTY_TREE;
        TreeElement results[] = new TreeElement[_children.size()];
        return (TreeElement[]) _children.toArray(results);
    }
835168
public FilterChain create() throws FilterConfigurationException {
        Preconditions.checkState(filters != null, "list of filters must be set");
        Preconditions.checkState(inputType != null, "inputType must be set");
        Preconditions.checkState(outputType != null, "outputType must be set");

        Preconditions.checkState(filters.size() > 0, "need at least one filter");
        validateFiltersList();

        Iterator<Object> iterator = filters.iterator();

        FilterChainElement firstInstance = getInstanceFromListElement(iterator.next());
        if (!firstInstance.getSupportedInputType().isAssignableFrom(inputType)
                || !firstInstance.getSupportedOutputType().isAssignableFrom(outputType)) {
            throw new FilterConfigurationException(String.format(
                "incompatible Filtertype (%s) should be (%s->%s) - is (%s->%s)",
                firstInstance.getClass(), inputType, outputType, firstInstance.getSupportedInputType(),
                firstInstance.getSupportedOutputType()));
        }
        FilterChainElement current = firstInstance;
        while (iterator.hasNext()) {
            Object next = iterator.next();
            FilterChainElement nextFilterElement = getInstanceFromListElement(next);
            if (nextFilterElement == null) {
                current.setNext((FilterAction) next);
                break;
            }
            current.setNext(nextFilterElement);
            current = nextFilterElement;
        }
        return new FilterChain(firstInstance);
    }
1180858
public static <T> List<T> filtered(Collection<T> data, Filter<T> filter) {
        List<T> list = new ArrayList<>();
        if (!Utils.isEmpty(data)) {
            for (T item : data) {
                if (filter.accept(item)) {
                    list.add(item);
                }
            }
        }
        return list;
    }
1139506
@Override
  public <T extends Filter> T createFilter(Class<T> classToCreate) throws ServletException {
      
      logger.logp(Level.FINE, CLASS_NAME, "createFilter", "called for class: " + classToCreate);
      return super.createFilter(classToCreate);
  }