Checks whether this media specification matches to at least one of the given media queries.
@param queries The list of media queries to be matched.
@return {@code true} when at least one query matches, {@code false} when no query matches.
6194
public boolean matchesOneOf(List<MediaQuery> queries)
    {
        for (MediaQuery q : queries)
        {
            if (matches(q))
                return true;
        }
        return false;
    }
1236583
public boolean matches(HttpServletRequest request) {
    if (httpMethod != null && httpMethod != HttpMethod.valueOf(request.getMethod())) { return false; }
    String url = request.getServletPath();
    String pathInfo = request.getPathInfo();
    String query = request.getQueryString();

    if (pathInfo != null || query != null) {
      StringBuilder sb = new StringBuilder(url);
      if (pathInfo != null) sb.append(pathInfo);
      if (query != null) sb.append(query);
      url = sb.toString();
    }
    logger.debug("Checking match of request : '{}'; against '{}'", url, pattern);
    return pattern.matcher(url).matches();
  }
620612
private boolean _findMatches() throws IOException {
    // queue not empty
    if (!queueMatches.isEmpty()) {
      return true;
      // no more matches to be found
    } else if (currentPosition == NO_MORE_POSITIONS) {
      return false;
      // try to find matches
    } else {
      // subMatches: try to build matches while collecting
      Integer subMatchesStartPosition = null;
      Boolean subMatchesOptional = true;
      List<Match> subMatchesQueue = new ArrayList<>();
      // minimum startPosition previous, used to set lower boundary on
      // startPosition next
      Integer minStartPositionPrevious = null;
      // maximum endPosition previous, used to set upper boundary on
      // startPosition next
      Integer maxEndPositionPrevious = null;
      // other variables
      Integer minStartPositionNext = null;
      Integer minStartPosition = null;
      Integer minOptionalStartPosition = null;
      // adjusted minimum ignoreItem
      boolean adjustedMinimumIgnoreItem = false;
      // fill queue if necessary and possible
      for (int i = 0; i < queueSpans.size(); i++) {
        QueueItem item = queueSpans.get(i);
        // if span is optional, check docId
        if (!item.sequenceSpans.optional || (item.sequenceSpans.spans != null
            && item.sequenceSpans.spans.docID() == docId)) {
          // compute minimum startPosition until next non-optional item
          // used as lower boundary on endPosition next
          minStartPositionNext = null;
          for (int j = (i + 1); j < queueSpans.size(); j++) {

            // check for available lowestPosition
            if (!queueSpans.get(j).sequenceSpans.optional
                && queueSpans.get(j).lowestPosition != null) {
              minStartPositionNext = (minStartPositionNext == null)
                  ? queueSpans.get(j).lowestPosition
                  : Math.min(minStartPositionNext,
                      queueSpans.get(j).lowestPosition);
              // computing restrictions not possible
            } else {
              if (!queueSpans.get(j).sequenceSpans.optional) {
                minStartPositionNext = null;
              }
              break;
            }
          }
          // fill queue
          if ((minStartPositionPrevious == null) || subMatchesOptional) {
            fillQueue(item, null, maxEndPositionPrevious, minStartPositionNext);
          } else {
            fillQueue(item, minStartPositionPrevious, maxEndPositionPrevious,
                minStartPositionNext);
          }
          // try to adjust minimum ignoreItem
          if (!adjustedMinimumIgnoreItem && !item.sequenceSpans.optional
              && item.filledPosition) {
            if (minOptionalStartPosition != null) {
              ignoreItem.removeBefore(docId,
                  Math.min(minOptionalStartPosition, item.lowestPosition));
            } else {
              ignoreItem.removeBefore(docId, item.lowestPosition);
            }
            adjustedMinimumIgnoreItem = true;
          }
          // check for available positions
          if (!item.sequenceSpans.optional && item.noMorePositions
              && !item.filledPosition) {
            currentPosition = NO_MORE_POSITIONS;
            return false;
          }
          // build matches
          subMatchesQueue = _glue(subMatchesQueue, subMatchesOptional, item);
          // update subMatchesOptional
          if (!item.sequenceSpans.optional) {
            subMatchesOptional = false;
          }
          // check if matches are still achievable
          if (!subMatchesOptional && subMatchesQueue.isEmpty()) {
            // clean up previous queues
            if (subMatchesStartPosition != null) {
              int cleanStartPosition = subMatchesStartPosition;
              for (int j = 0; j <= i; j++) {
                queueSpans.get(j).del(cleanStartPosition);
                if (!queueSpans.get(j).sequenceSpans.optional) {
                  cleanStartPosition++;
                }
              }
            }
            return false;
          }
          // update subMatchesStartPosition
          if (subMatchesQueue.isEmpty()) {
            subMatchesStartPosition = null;
          } else {
            subMatchesStartPosition = subMatchesQueue.get(0).startPosition;
          }
          // compute minimum startPosition for next span
          if (item.lowestPosition != null) {
            minStartPositionPrevious = (minStartPositionPrevious == null)
                ? item.lowestPosition
                : Math.min(minStartPositionPrevious, item.lowestPosition);
          }
          // for optional spans
          if (item.sequenceSpans.optional) {
            // update stats
            if (item.lowestPosition != null) {
              minOptionalStartPosition = (minOptionalStartPosition == null)
                  ? item.lowestPosition
                  : Math.min(minOptionalStartPosition, item.lowestPosition);
            }
            // for not optional spans
          } else {
            // update stats, item.lowestPosition should be set
            minStartPosition = (minStartPosition == null) ? item.lowestPosition
                : Math.min(minStartPosition, item.lowestPosition);
            // reset maximum endPosition for next span
            maxEndPositionPrevious = null;
          }
          // compute maximum endPosition for next span
          if (item.lowestPosition != null) {
            for (Integer endPosition : item.queue.get(item.lowestPosition)) {
              maxEndPositionPrevious = (maxEndPositionPrevious == null)
                  ? endPosition : Math.max(maxEndPositionPrevious, endPosition);
            }
          }
        }
      }
      if (subMatchesQueue.isEmpty()) {
        // condition has only optional parts
        if (subMatchesOptional) {
          // check for
          boolean allFinished = true;
          for (int i = 0; i < queueSpans.size(); i++) {
            if (!queueSpans.get(i).noMorePositions) {
              allFinished = false;
              break;
            }
          }
          if (allFinished) {
            currentPosition = NO_MORE_POSITIONS;
          }
        }
        return false;
      } else if ((minOptionalStartPosition != null)
          && (minOptionalStartPosition < subMatchesStartPosition)) {
        for (int i = 0; i < queueSpans.size(); i++) {
          if (!queueSpans.get(i).sequenceSpans.optional) {
            break;
          } else {
            queueSpans.get(i).del(minOptionalStartPosition);
          }
        }
        return false;
      } else {
        for (int i = 0; i < queueSpans.size(); i++) {
          queueSpans.get(i).del(subMatchesStartPosition);
        }
        for (Match m : subMatchesQueue) {
          if (!queueMatches.contains(m)) {
            queueMatches.add(m);
          }
        }
        ignoreItem.removeBefore(docId, queueMatches.get(0).startPosition);
        return true;
      }
    }
  }
1081236
private boolean scopeContainsInstances(GraqlCompute query, ConceptId... ids) {
        for (ConceptId id : ids) {
            Thing thing = tx.getConcept(id);
            if (thing == null || !scopeTypeLabels(query).contains(thing.type().label())) return false;
        }
        return true;
    }
824941
public static final boolean hasRemaining(ByteBuffer[] buffers) {
    if (buffers == null) {
      return false;
    }
    for (int i = 0; i < buffers.length; i++) {
      if (buffers[i] != null && buffers[i].hasRemaining()) {
        return true;
      }
    }
    return false;
  }
769583
public boolean contains(final MediaTypes types) {
        boolean contains = false;
        for (final MediaType type : types.list) {
            if (this.contains(type)) {
                contains = true;
                break;
            }
        }
        return contains;
    }
876450
public boolean matches(ApiRequest request) {
        String apiOrgId = request.getApiOrgId();
        String apiId = request.getApiId();
        String apiVersion = request.getApiVersion();
        return matches(apiOrgId, apiId, apiVersion);
    }
902840
public boolean contains(T query){
		if (isEmpty() || query == null) {
			return false;
		}

		int startCompare = start == null ? 1 : query.compareTo(start);
		int endCompare = end == null ? -1 : query.compareTo(end);
		if (startCompare > 0 && endCompare < 0) {
			return true;
		}
		return (startCompare == 0 && isStartInclusive) || (endCompare == 0 && isEndInclusive);
	}
1354195
protected boolean hasMatchingMediaType(MediaType mediaType) {
		if (mediaType != null) {
			String subtype = mediaType.getSubtype();
			return "json".equalsIgnoreCase(subtype) || subtype.endsWith("+json") || "javascript".equals(subtype) || "x-javascript".equals(subtype);
		}
		return true;
	}
1214893
public boolean isPanelsQuery(Query query, Panel panel) {
    Panel queryPanel = resourceController.getResourcePanel(query);
    if (queryPanel == null || panel == null) {
      return false;
    }
    
    return queryPanel.getId().equals(panel.getId());
  }
632586
public static boolean matchesFilter(String key, List<String> filters) {
		boolean rets = (null == filters);
		if (!rets) {
			for (Iterator<String> it = filters.iterator(); it.hasNext() && !rets;)
				rets = key.startsWith(it.next());
		}

		return rets;
	}
362712
public boolean contains(final MediaType type) {
        boolean contains = false;
        for (final MediaType mine : this.list) {
            if (mine.matches(type)) {
                contains = true;
                break;
            }
        }
        return contains;
    }
623753
@Override
    public boolean matches(IAtomContainer targetContainer, IBond targetBond) {
        if (this.smartQueryBond != null && queryBond == null) {
            return smartQueryBond.matches(targetBond);
        } else {
            if (!isBondMatchFlag()) {
                return true;
            }
            if (isBondMatchFlag() && isBondTypeMatch(targetBond)) {
                return true;
            }
            if (isBondMatchFlag() && this.unsaturation == getUnsaturation(targetContainer, targetBond)) {
                return true;
            }
        }
        return false;
    }
689111
public List<Object> match() {
        final IntMatchResults result = new IntMatchResults();
        if (matches(result)) {
            return result.getIntResultList();
        } else {
            return null;
        }
    }
1323183
protected boolean isValidQuery(String query) {
        if (query == null) {
            return true;
        }
        
        return QUERY_PATTERN.matcher(query).matches();
    }
227380
@NonNull
    public Expression match(@NonNull String query) {
        if (query == null) {
            throw new IllegalArgumentException("query is null.");
        }
        return new FullTextMatchExpression(this.name, query);
    }
1015376
private function isQueryIncluded(array $queryParams)
    {
        if (empty($queryParams)) {
            return true;
        }

        if ($this->includedQuery === '*') {
            return true;
        }

        if (empty($this->includedQuery) && !is_numeric($this->includedQuery)) {
            return false;
        }

        $includedParams = array_intersect_key($queryParams, array_flip((array)$this->includedQuery));
        return (count($includedParams) > 0);
    }