java.util.TreeSet.containsAll()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中java.util.TreeSet.containsAll()方法的一些代码示例,展示了TreeSet.containsAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TreeSet.containsAll()方法的具体详情如下:
包路径:java.util.TreeSet
类名称:TreeSet
方法名:containsAll

TreeSet.containsAll介绍

暂无

代码示例

代码示例来源:origin: voldemort/voldemort

public void add(MoveMap rhs) {
  if(!idKeySet.containsAll(rhs.idKeySet) || !rhs.idKeySet.containsAll(idKeySet)) {
    throw new VoldemortException("MoveMap objects cannot be added! They have incompatible id sets ("
                   + idKeySet + " vs. " + rhs.idKeySet + ").");
  }
  for(Integer fromId: idKeySet) {
    for(Integer toId: idKeySet) {
      int moves = get(fromId, toId) + rhs.get(fromId, toId);
      fromToMoves.get(fromId).put(toId, moves);
    }
  }
}

代码示例来源:origin: ankidroid/Anki-Android

checkAllItem.setOnMenuItemClickListener(menuItem -> {
  boolean changed = false;
  if (mCurrentTags.containsAll(mTagsArrayAdapter.mTagsList)) {
    mCurrentTags.removeAll(mTagsArrayAdapter.mTagsList);
    changed = true;

代码示例来源:origin: com.webguys.ponzu/impl

@Override
public boolean containsAll(Collection<?> collection)
{
  return this.treeSet.containsAll(collection);
}

代码示例来源:origin: gradle.plugin.com.s390x/gogradle

@Override
public boolean containsAll(Collection<?> c) {
  return container.containsAll(c);
}

代码示例来源:origin: apache/jackrabbit

/**
 * Determines whether this effective node type representation includes
 * (either through inheritance or aggregation) all of the given node types.
 *
 * @param nodeTypeNames array of node type names
 * @return <code>true</code> if all of the given node types are included,
 *         otherwise <code>false</code>
 */
public boolean includesNodeTypes(Name[] nodeTypeNames) {
  return allNodeTypes.containsAll(Arrays.asList(nodeTypeNames));
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * Determines whether this effective node type representation includes
 * (either through inheritance or aggregation) all of the given node types.
 *
 * @param nodeTypeNames array of node type names
 * @return <code>true</code> if all of the given node types are included,
 *         otherwise <code>false</code>
 */
public boolean includesNodeTypes(Name[] nodeTypeNames) {
  return allNodeTypes.containsAll(Arrays.asList(nodeTypeNames));
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr2spi

public boolean includesNodeTypes(Name[] nodeTypeNames) {
  return allNodeTypes.containsAll(Arrays.asList(nodeTypeNames));
}

代码示例来源:origin: CyclopsMC/IntegratedDynamics

/**
 * Check if two networks are equal.
 * @param networkA A network.
 * @param networkB Another network.
 * @return If they are equal.
 */
public static boolean areNetworksEqual(Network networkA, Network networkB) {
  return networkA.elements.containsAll(networkB.elements) && networkA.elements.size() == networkB.elements.size();
}

代码示例来源:origin: apache/jackrabbit

public boolean includesNodeTypes(Name[] nodeTypeNames) {
  return allNodeTypes.containsAll(Arrays.asList(nodeTypeNames));
}

代码示例来源:origin: geogebra/geogebra

private static boolean predecessorsCovered(GeoElementND ps2n,
      TreeSet<GeoElement> ancestors) {
    return ancestors.containsAll(
        getAllIndependentPredecessors(ps2n.toGeoElement()));
  }
}

代码示例来源:origin: jpox/jpox

/**
 * Accessor for whether a collection is contained in this Set.
 * @param c The collection
 * @return Whether it is contained.
 **/
public synchronized boolean containsAll(java.util.Collection c)
{
  if (useCache)
  {
    loadFromStore();
  }
  else if (backingStore != null)
  {
    java.util.TreeSet tree = new java.util.TreeSet(c);
    Iterator iter=iterator();
    while (iter.hasNext())
    {
      tree.remove(iter.next());
    }
    return tree.isEmpty();
  }
  return delegate.containsAll(c);
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel

@Override
public boolean containsAll(Collection c) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.containsAll(c);
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

@Override
public boolean containsAll(Collection c) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.containsAll(c);
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

@Override
public boolean containsAll(Collection c) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.containsAll(c);
}

代码示例来源:origin: jpox/jpox

/**
 * Accessor for whether a collection is contained in this Set.
 * @param c The collection
 * @return Whether it is contained.
 **/
public synchronized boolean containsAll(java.util.Collection c)
{
  if (useCache)
  {
    loadFromStore();
  }
  else if (backingStore != null)
  {
    java.util.SortedSet sorted = new java.util.TreeSet(c);
    Iterator iter=iterator();
    while (iter.hasNext())
    {
      sorted.remove(iter.next());
    }
    return sorted.isEmpty();
  }
  return delegate.containsAll(c);
}

代码示例来源:origin: org.apache.openjpa/openjpa-kernel

@Override
public boolean containsAll(Collection c) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.containsAll(c);
}

代码示例来源:origin: org.opencadc/cadc-access-control

/**
 * A User is considered consistent if the User's set of identities are a superset
 * of this Users set of identities.
 *
 * @param superset
 * @return true if the user is consistent, false otherwise
 */
public boolean isConsistent(final User superset)
{
  if (superset == null)
  {
    return false;
  }
  if (this.identities.size() == 0 || superset.identities.size() == 0)
  {
    return false;
  }
  PrincipalComparator p = new PrincipalComparator();
  TreeSet<Principal> set1 = new TreeSet<Principal>(p);
  TreeSet<Principal> set2 = new TreeSet<Principal>(p);
  set1.addAll(superset.getIdentities());
  set2.addAll(this.getIdentities());
  return set1.containsAll(set2);
}

代码示例来源:origin: org.jboss.javaee/jboss-javaee

implies = httpMethods.containsAll(perm.httpMethods);

代码示例来源:origin: org.openrdf/sesame

if (_memberSet.containsAll(set2)) {
  return true;

代码示例来源:origin: org.geoserver/gs-wfs

@Test
public void testSupportedSpatialOperators() throws Exception {
  Document doc = getAsDOM("wfs?service=WFS&request=getCapabilities&version=1.0.0");
  Element spatialOperators = getFirstElementByTagName(doc, "ogc:Spatial_Operators");
  NodeList ops = spatialOperators.getChildNodes();
  TreeSet<String> o = new TreeSet<String>();
  for (int i = 0; i < ops.getLength(); i++) {
    String operator = ops.item(i).getLocalName();
    o.add(operator);
  }
  List<String> expectedSpatialOperators = getSupportedSpatialOperatorsList(true);
  assertEquals(expectedSpatialOperators.size(), o.size());
  assertTrue(o.containsAll(expectedSpatialOperators));
}

相关文章