Carry out a one level search

@param base
@param filter
@return DirSearchResult
@throws NamingException
322308
public boolean searchOne(String base, String filter) throws NamingException {
    return search(base, filter, scopeOne);
  }
915640
function( filter, context ) {
			context = this.getFilterContext( context );

			// Apply the root filter.
			filter.onRoot( context, this );

			this.filterChildren( filter, false, context );
		}
1078105
public final void findCallingMethodsInDir(final File dir, final FileFilter filter) {

        final FileProcessor fileProcessor = new FileProcessor(new FileHandler() {
            @Override
            public final FileHandlerResult handleFile(final File file) {
                if (file.isDirectory()) {
                    return FileHandlerResult.CONTINUE;
                }
                if (file.getName().endsWith(".class") && (filter == null || filter.accept(file))) {
                    handleClass(file);
                }
                return FileHandlerResult.CONTINUE;
            }
        });
        fileProcessor.process(dir);

    }
1345554
protected function searchForOneNode(Filter\AbstractFilter $filter, $attributes = null, $searchScope = Connection::SEARCH_SCOPE_SUB, $maxFilterTime = 0)
    {
        $results = $this->searchNodes($filter, $attributes, $searchScope, 1, $maxFilterTime);

        if ($results->count() === 0) {
            return null;
        }

        return $results->getFirst();
    }
1021030
public DocumentT findOne(final Bson filter, final RemoteFindOptions options) {
    return executeFindOne(filter, options, documentClass);
  }
212175
public Query<S> query(String filter) throws FetchException {
        synchronized (mStringToQuery) {
            Query<S> query = mStringToQuery.get(filter);
            if (query == null) {
                if (filter == null) {
                    throw new IllegalArgumentException("Query filter must not be null");
                }
                query = query(Filter.filterFor(mType, filter), null);
                mStringToQuery.put(filter, query);
            }
            return query;
        }
    }
395624
public static SearchRequest newLdaptiveSearchRequest(final String baseDn,
                                                         final SearchFilter filter) {
        return newLdaptiveSearchRequest(baseDn, filter, ReturnAttributes.ALL_USER.value(), ReturnAttributes.ALL_USER.value());
    }
1128204
public ServerFilter where(Predicate<ServerMetadata> filter) {
        checkNotNull(filter, "Filter must be not a null");

        predicate = predicate.and(filter);

        return this;
    }
576249
private FilterDescriptor createFilter(FilterType filterType, Map<String, FilterDescriptor> filters, ScannerContext context) {
        Store store = context.getStore();
        FilterDescriptor filterDescriptor = getOrCreateNamedDescriptor(FilterDescriptor.class, filterType.getFilterName().getValue(), filters, store);
        setAsyncSupported(filterDescriptor, filterType.getAsyncSupported());
        for (DescriptionType descriptionType : filterType.getDescription()) {
            filterDescriptor.getDescriptions().add(XmlDescriptorHelper.createDescription(descriptionType, store));
        }
        for (DisplayNameType displayNameType : filterType.getDisplayName()) {
            filterDescriptor.getDisplayNames().add(XmlDescriptorHelper.createDisplayName(displayNameType, store));
        }
        FullyQualifiedClassType filterClass = filterType.getFilterClass();
        if (filterClass != null) {
            TypeResolver typeResolver = context.peek(TypeResolver.class);
            TypeCache.CachedType<TypeDescriptor> filterClassDescriptor = typeResolver.resolve(filterClass.getValue(), context);
            filterDescriptor.setType(filterClassDescriptor.getTypeDescriptor());
        }
        for (IconType iconType : filterType.getIcon()) {
            IconDescriptor iconDescriptor = XmlDescriptorHelper.createIcon(iconType, store);
            filterDescriptor.getIcons().add(iconDescriptor);
        }
        for (ParamValueType paramValueType : filterType.getInitParam()) {
            ParamValueDescriptor paramValueDescriptor = createParamValue(paramValueType, store);
            filterDescriptor.getInitParams().add(paramValueDescriptor);
        }
        return filterDescriptor;
    }
838158
public <T> List<T> search(Class<T> managedClass, Name base, String filter, SearchControls scope) {
        Filter searchFilter = null;
        if(StringUtils.hasText(filter)) {
            searchFilter = new HardcodedFilter(filter);
        }

        return ldapTemplate.find(base, searchFilter, scope, managedClass);
    }
757083
public TextSearch filter(final SearchFilter filter) {
		if (filters == null) {
			filters = new HashSet<SearchFilter>();
		}
		filters.add(filter);

		return this;
	}
285112
function search(keyword, typeFilter) {
        keyword = keyword.toLowerCase();
        typeFilter = typeFilter || type.Element;
        var results = findAll(function (elem) {
            var name = elem.name ? elem.name.toLowerCase() : "";
            return (name.indexOf(keyword) > -1 && elem instanceof typeFilter);
        });
        return results;
    }
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;
    }
86483
private Response<SearchResult> searchForId(final String id) throws LdapException {
        val filter = LdapUtils.newLdaptiveSearchFilter(this.searchFilter,
            LdapUtils.LDAP_SEARCH_FILTER_DEFAULT_PARAM_NAME,
            CollectionUtils.wrap(id));
        return LdapUtils.executeSearchOperation(this.connectionFactory, this.baseDn, filter);
    }
303492
public void addFilter(Filter filter)
   {
      if (filter.isTaskFilter())
      {
         m_taskFilters.add(filter);
      }

      if (filter.isResourceFilter())
      {
         m_resourceFilters.add(filter);
      }

      m_filtersByName.put(filter.getName(), filter);
      m_filtersByID.put(filter.getID(), filter);
   }
242873
public static Filter getFilter(String name) {

        Filter filter = FILTERS.get(name);

        if (filter == null) {
            throw new RuntimeException("unknown filter: " + name);
        }

        return filter;
    }
940436
@SneakyThrows
    public Collection<GitObject> getObjectsInRepository(final TreeFilter filter) {
        val repository = this.gitInstance.getRepository();
        val head = repository.resolve(Constants.HEAD);

        try (val walk = new RevWalk(repository)) {
            val commit = walk.parseCommit(head);
            val tree = commit.getTree();
            try (val treeWalk = new TreeWalk(repository)) {
                treeWalk.addTree(tree);
                treeWalk.setRecursive(true);
                treeWalk.setFilter(filter);
                val list = new ArrayList<GitObject>();
                while (treeWalk.next()) {
                    val object = readObject(treeWalk);
                    list.add(object);
                }
                return list;
            }
        }
    }