当前位置: 首页>>代码示例>>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;未经允许,请勿转载。