當前位置: 首頁>>代碼示例>>Java>>正文


Java Deque.contains方法代碼示例

本文整理匯總了Java中java.util.Deque.contains方法的典型用法代碼示例。如果您正苦於以下問題:Java Deque.contains方法的具體用法?Java Deque.contains怎麽用?Java Deque.contains使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Deque的用法示例。


在下文中一共展示了Deque.contains方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doBuildResolvedResult

import java.util.Deque; //導入方法依賴的package包/類
private List<DependentBinariesResolvedResult> doBuildResolvedResult(final NativeBinarySpecInternal target, State state, Deque<NativeBinarySpecInternal> stack) {
    if (stack.contains(target)) {
        onCircularDependencies(state, stack, target);
    }
    List<DependentBinariesResolvedResult> result = resultsCache.getIfPresent(target);
    if (result != null) {
        return result;
    }
    stack.push(target);
    result = Lists.newArrayList();
    List<NativeBinarySpecInternal> dependents = state.getDependents(target);
    for (NativeBinarySpecInternal dependent : dependents) {
        List<DependentBinariesResolvedResult> children = doBuildResolvedResult(dependent, state, stack);
        result.add(new DefaultDependentBinariesResolvedResult(dependent.getId(), dependent.getProjectScopedName(), dependent.isBuildable(), isTestSuite(dependent), children));
    }
    stack.pop();
    resultsCache.put(target, result);
    return result;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:20,代碼來源:NativeDependentBinariesResolutionStrategy.java

示例2: checkCycles

import java.util.Deque; //導入方法依賴的package包/類
public static boolean checkCycles(Node node, Deque<Node> path) {

      Iterator iter = node.getChildren().iterator();
      while (iter.hasNext()) {
        Node child = (Node)iter.next();
        if (path.contains(child)) {
          return true;
        }
        else {
          path.push(child);
          if (checkCycles(child, path)==true) {
            return true;
          }
          else {
            path.pop();
          }
        }
      }
      return false;
    }
 
開發者ID:tag42git,項目名稱:CsvTupler,代碼行數:21,代碼來源:NodeFactory.java

示例3: visit

import java.util.Deque; //導入方法依賴的package包/類
private void visit(ResourcePoolModule node,
                   Deque<ResourcePoolModule> visited,
                   Deque<ResourcePoolModule> done) {
    if (visited.contains(node)) {
        if (!done.contains(node)) {
            throw new IllegalArgumentException("Cyclic detected: " +
                node + " " + edges.get(node.name()));
        }
        return;
    }
    visited.add(node);
    edges.get(node.name())
         .forEach(x -> visit(x, visited, done));
    done.add(node);
    result.addLast(node);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:17,代碼來源:ModuleSorter.java

示例4: extractThriftStructMetadata

import java.util.Deque; //導入方法依賴的package包/類
private ThriftStructMetadata extractThriftStructMetadata(Type structType)
{
    requireNonNull(structType, "structType is null");

    Deque<Type> stack = this.stack.get();
    if (stack.contains(structType)) {
        String path = Stream.concat(stack.stream(), Stream.of(structType))
                .map(type -> TypeToken.of(type).getRawType().getName())
                .collect(joining("->"));
        throw new IllegalArgumentException(
                "Circular references must be qualified with 'isRecursive' on a @ThriftField annotation in the cycle: " + path);
    }
    else {
        stack.push(structType);

        try {
            ThriftStructMetadataBuilder builder = new ThriftStructMetadataBuilder(this, structType);
            return builder.build();
        }
        finally {
            Type top = stack.pop();
            checkState(
                    structType.equals(top),
                    "ThriftCatalog circularity detection stack is corrupt: expected %s, but got %s",
                    structType,
                    top);
        }
    }
}
 
開發者ID:airlift,項目名稱:drift,代碼行數:30,代碼來源:ThriftCatalog.java

示例5: extractThriftUnionMetadata

import java.util.Deque; //導入方法依賴的package包/類
private ThriftStructMetadata extractThriftUnionMetadata(Type unionType)
{
    requireNonNull(unionType, "unionType is null");

    Deque<Type> stack = this.stack.get();
    if (stack.contains(unionType)) {
        String path = Stream.concat(stack.stream(), Stream.of(unionType))
                .map(type -> TypeToken.of(type).getRawType().getName())
                .collect(joining("->"));
        throw new IllegalArgumentException(
                "Circular references must be qualified with 'isRecursive' on a @ThriftField annotation in the cycle: " + path);
    }

    stack.push(unionType);
    try {
        ThriftUnionMetadataBuilder builder = new ThriftUnionMetadataBuilder(this, unionType);
        return builder.build();
    }
    finally {
        Type top = stack.pop();
        checkState(
                unionType.equals(top),
                "ThriftCatalog circularity detection stack is corrupt: expected %s, but got %s",
                unionType,
                top);
    }
}
 
開發者ID:airlift,項目名稱:drift,代碼行數:28,代碼來源:ThriftCatalog.java

示例6: _stackContains

import java.util.Deque; //導入方法依賴的package包/類
private static boolean _stackContains(Deque<?> stack, Object value)
{
  if (stack == null)
    return false;

  return stack.contains(value);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:8,代碼來源:StyleSheetDocument.java

示例7: stringToDumpFileHistory

import java.util.Deque; //導入方法依賴的package包/類
public static Deque<File> stringToDumpFileHistory(String preference, boolean allowDirs) {
    String[] coordStrings = preference.split(DbInfo.DELIM_ENTRY);
    Deque<File> paths = new LinkedList<>();
    for (String path : coordStrings){
        File f = new File(path);
        if (f.exists() && !paths.contains(f) && (allowDirs || !f.isDirectory())) {
            paths.add(f);
        }
    }
    return paths;
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:12,代碼來源:DbStorePicker.java

示例8: getFieldList

import java.util.Deque; //導入方法依賴的package包/類
private static void getFieldList(Class clazz, List<String> fieldList, String prefix, Deque<Class> classStack) throws IntrospectionException {
    //To avoid recursion, bail out if the input Class has already been introspected
    if (classStack.contains(clazz)) {
        if (log.isDebugEnabled())
            log.debug("Fields from " + clazz + " prefixed by " + prefix + " will be ignored, since the class has already been introspected as per the stack " + classStack);
        return;
    } else
        classStack.addFirst(clazz);

    //Introspect the input Class
    BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
    if (beanInfo != null) {
        PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
        if (pds != null) {
            for (PropertyDescriptor pd : pds) {
                if (pd.getReadMethod() != null && pd.getWriteMethod() != null) {
                    String name = pd.getName();
                    String qualifieldName = prefix == null || prefix.length() == 0 ? name : prefix + '.' + name;
                    Class type = pd.getPropertyType();
                    if (type.isArray())
                        type = type.getComponentType();
                    if (type == String.class || type == Boolean.class || Number.class.isAssignableFrom(type) || IDateBase.class.isAssignableFrom(type) || Currency.class.isAssignableFrom(type) || type.isPrimitive() || type.isEnum())
                        fieldList.add(qualifieldName);
                    else
                        getFieldList(type, fieldList, qualifieldName, classStack);
                }
            }
        }
    }

    classStack.removeFirst();
}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:33,代碼來源:PropertyFilter.java

示例9: sort

import java.util.Deque; //導入方法依賴的package包/類
private void sort() {
    Deque<T> visited = new LinkedList<>();
    Deque<T> done = new LinkedList<>();
    T node;
    while ((node = nodes.poll()) != null) {
        if (!visited.contains(node)) {
            visit(node, visited, done);
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:11,代碼來源:Graph.java

示例10: visit

import java.util.Deque; //導入方法依賴的package包/類
private void visit(T node, Deque<T> visited, Deque<T> done) {
    if (visited.contains(node)) {
        if (!done.contains(node)) {
            throw new IllegalArgumentException("Cyclic detected: " +
                node + " " + graph.edges().get(node));
        }
        return;
    }
    visited.add(node);
    graph.edges().get(node).stream()
        .forEach(x -> visit(x, visited, done));
    done.add(node);
    result.addLast(node);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:Graph.java

示例11: build

import java.util.Deque; //導入方法依賴的package包/類
private synchronized void build() {
    if (!result.isEmpty() || nodes.isEmpty())
        return;

    Deque<ResourcePoolModule> visited = new LinkedList<>();
    Deque<ResourcePoolModule> done = new LinkedList<>();
    ResourcePoolModule node;
    while ((node = nodes.poll()) != null) {
        if (!visited.contains(node)) {
            visit(node, visited, done);
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:14,代碼來源:ModuleSorter.java


注:本文中的java.util.Deque.contains方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。