当前位置: 首页>>代码示例>>Java>>正文


Java Collections.emptySet方法代码示例

本文整理汇总了Java中java.util.Collections.emptySet方法的典型用法代码示例。如果您正苦于以下问题:Java Collections.emptySet方法的具体用法?Java Collections.emptySet怎么用?Java Collections.emptySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Collections的用法示例。


在下文中一共展示了Collections.emptySet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convert

import java.util.Collections; //导入方法依赖的package包/类
private Set<Entry> convert ( final DataItemValue value )
{
    if ( value == null || value.getAttributes () == null )
    {
        return Collections.emptySet ();
    }

    final Set<Entry> entries = new HashSet<AttributesPart.Entry> ( value.getAttributes ().size () );

    for ( final Map.Entry<String, Variant> entry : value.getAttributes ().entrySet () )
    {
        final Variant entryValue = entry.getValue ();
        if ( entryValue != null )
        {
            entries.add ( new Entry ( entry.getKey (), entryValue.getType ().toString (), entryValue.toLabel () ) );
        }
        else
        {
            entries.add ( new Entry ( entry.getKey (), null, null ) );
        }
    }

    return entries;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:25,代码来源:AttributesPart.java

示例2: generateAtConstructor

import java.util.Collections; //导入方法依赖的package包/类
protected Collection<Pair<AccessGraph, EdgeFunction<TypestateDomainValue>>> generateAtConstructor(Unit unit,
		Collection<SootMethod> calledMethod, MatcherTransition initialTrans) {
	boolean matches = false;
	for (SootMethod method : calledMethod) {
		if (initialTrans.matches(method)) {
			matches = true;
		}
	}
	if (!matches)
		return Collections.emptySet();
	if (unit instanceof Stmt) {
		Stmt stmt = (Stmt) unit;
		if (stmt.containsInvokeExpr())
			if (stmt.getInvokeExpr() instanceof InstanceInvokeExpr) {
				InstanceInvokeExpr iie = (InstanceInvokeExpr) stmt.getInvokeExpr();
				if (iie.getBase() instanceof Local) {
					Local l = (Local) iie.getBase();
					Set<Pair<AccessGraph, EdgeFunction<TypestateDomainValue>>> out = new HashSet<>();
					out.add(new Pair<AccessGraph, EdgeFunction<TypestateDomainValue>>(
							new AccessGraph(l, l.getType()), new TransitionFunction(initialTrans)));
					return out;
				}
			}
	}
	return Collections.emptySet();
}
 
开发者ID:themaplelab,项目名称:ideal,代码行数:27,代码来源:MatcherStateMachine.java

示例3: languagePaths

import java.util.Collections; //导入方法依赖的package包/类
public Set<LanguagePath> languagePaths() {
    ensureReadLocked();
    Set<LanguagePath> lps;
    synchronized (rootTokenList) {
        lps = languagePaths;
        if (lps == null) {
            if (!isActiveImpl())
                return Collections.emptySet();
            Language<?> lang = rootTokenList.language();
            LanguageOperation<?> langOp = LexerApiPackageAccessor.get().languageOperation(lang);
            @SuppressWarnings("unchecked")
            Set<LanguagePath> clps = (Set<LanguagePath>)
                    ((HashSet<LanguagePath>)langOp.languagePaths()).clone();
            lps = clps;

            @SuppressWarnings("unchecked")
            Set<Language<?>> cel = (Set<Language<?>>)
                    ((HashSet<Language<?>>)langOp.exploredLanguages()).clone();
            exploredLanguages = cel;
            languagePaths = lps;
        }
    }
    return lps;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:TokenHierarchyOperation.java

示例4: getFeaturesReply

import java.util.Collections; //导入方法依赖的package包/类
@JsonIgnore
public OFFeaturesReply getFeaturesReply(OFFactory factory) {
	/**
     * FIXME Icky work around; if a null actions got written to storage
     * then fake up an empty one so the builder() doesn't throw
     * a NPE.  Need to root cause why someone would write a null actions.
     * This code will all be removed shortly -- needed to unblock BVS team.
     */
    Set<OFActionType> workAroundActions;
    if (actions != null)
        workAroundActions = actions;
    else
        workAroundActions = Collections.<OFActionType> emptySet();

    OFFeaturesReply featuresReply = factory.buildFeaturesReply()
            .setXid(0)
            .setDatapathId(dpid)
            .setNBuffers(buffers)
            .setNTables(tables)
            .setCapabilities(capabilities)
            .setActions(workAroundActions)
            .setPorts(toOFPortDescList(factory, ports))
            .build();
    return featuresReply;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:26,代码来源:SwitchSyncRepresentation.java

示例5: getReturnTransitionsFor

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Set<Transition> getReturnTransitionsFor(AccessGraph callerD1, Unit callSite,
    SootMethod calleeMethod, Unit exitStmt, AccessGraph exitNode, Unit returnSite,
    AccessGraph retNode) {
  if (retrieveHasNextMethods().contains(calleeMethod)) {
    if (icfg.getMethodOf(callSite).getSignature().contains("java.lang.Object next()"))
      return Collections.emptySet();
  }

  return super.getReturnTransitionsFor(callerD1, callSite, calleeMethod, exitStmt, exitNode, returnSite, retNode);
}
 
开发者ID:themaplelab,项目名称:ideal,代码行数:12,代码来源:HasNextStateMachine.java

示例6: generateEqualsAndHashCode

import java.util.Collections; //导入方法依赖的package包/类
public static void generateEqualsAndHashCode(WorkingCopy wc, TreePath path) {
    ExecutableElement[] arr = overridesHashCodeAndEquals(wc, wc.getTrees().getElement(path), null);

    Collection<VariableElement> e = arr[0] == null ? Collections.<VariableElement>emptySet() : null;
    Collection<VariableElement> h = arr[1] == null ? Collections.<VariableElement>emptySet() : null;

    generateEqualsAndHashCode(wc, path, e, h, -1);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:EqualsHashCodeGenerator.java

示例7: getPluginFiles

import java.util.Collections; //导入方法依赖的package包/类
private static Collection<String> getPluginFiles (File cluster, String cnb, File updateTracking) {
    Collection<String> res = new HashSet<String> ();
    LOG.log(Level.FINE, "Read update_tracking " + updateTracking + " file.");
    Node updateTrackingConf = getUpdateTrackingConf(updateTracking);
    if (updateTrackingConf == null) {
        return Collections.emptySet();
    }
    Set<String> moduleFiles = readModuleFiles(updateTrackingConf);
    String configFile = "config/Modules/" + cnb.replace ('.', '-') + ".xml"; // NOI18N

    moduleFiles.remove (configFile);

    for (String fileName : moduleFiles) {
        File file = new File (cluster, fileName);
        if (! file.exists ()) {
            LOG.log (Level.WARNING, "File " + file + " doesn't exist for module " + cnb);
            continue;
        }
        if (file.equals (updateTracking)) {
            continue;
        }
        res.add (fileName);
    }

    res.add (TRACKING_FILE_NAME + '/' + cnb.replace ('.', '-') + ".xml"); // NOI18N);

    LOG.log(Level.FINEST, cnb + " has files: " + res);
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:PluginImporter.java

示例8: keys

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Set<String> keys() {
	if(role==TripleComponentRole.OBJECT && id>graph.getNShared()) {
		return Collections.emptySet();
	}
	return new VertexPropertySet(this);
}
 
开发者ID:rdfhdt,项目名称:hdt-gremlin,代码行数:8,代码来源:HDTVertex.java

示例9: getAllModuleElements

import java.util.Collections; //导入方法依赖的package包/类
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public Set<? extends ModuleElement> getAllModuleElements() {
    if (allowModules)
        return Collections.unmodifiableSet(modules.allModules());
    else
        return Collections.emptySet();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:JavacElements.java

示例10: SubjectAttributeResolver

import java.util.Collections; //导入方法依赖的package包/类
public SubjectAttributeResolver(final SubjectAttributeReader subjectAttributeReader, final String subjectIdentifier,
        final Set<Attribute> supplementalSubjectAttributes) {
    this.subjectAttributeReader = subjectAttributeReader;
    this.subjectIdentifier = subjectIdentifier;
    if (null == supplementalSubjectAttributes) {
        this.supplementalSubjectAttributes = Collections.emptySet();
    } else {
        this.supplementalSubjectAttributes = supplementalSubjectAttributes;
    }
}
 
开发者ID:eclipse,项目名称:keti,代码行数:11,代码来源:SubjectAttributeResolver.java

示例11: queryTunnel

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst) {
    Collection<Tunnel> result = new HashSet<>();
    Tunnel tunnel = null;
    for (TunnelId tunnelId : tunnelIdAsKeyStore.keySet()) {
        tunnel = tunnelIdAsKeyStore.get(tunnelId);

        if ((null != tunnel) && (src.equals(tunnel.src())) && (dst.equals(tunnel.dst()))) {
            result.add(tunnel);
        }
    }

    return result.isEmpty() ? Collections.emptySet() : ImmutableSet.copyOf(result);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:15,代码来源:PcepTunnelAddedTest.java

示例12: testNetworkPartitionDetected

import java.util.Collections; //导入方法依赖的package包/类
@Test
public void testNetworkPartitionDetected() throws IOException {
  initMocks(true);
  prepareAndInstallView(mockMembers[0], createMemberList(mockMembers[0], gmsJoinLeaveMemberId));

  // set up a view with sufficient members, then create a new view
  // where enough weight is lost to cause a network partition

  List<InternalDistributedMember> mbrs = new LinkedList<>();
  mbrs.add(mockMembers[0]);
  mbrs.add(mockMembers[1]);
  mbrs.add(mockMembers[2]);
  mbrs.add(gmsJoinLeaveMemberId);

  ((GMSMember) mockMembers[1].getNetMember()).setMemberWeight((byte) 20);

  NetView newView = new NetView(mockMembers[0], gmsJoinLeave.getView().getViewId() + 1, mbrs);
  InstallViewMessage installViewMessage = getInstallViewMessage(newView, credentials, false);
  gmsJoinLeave.processMessage(installViewMessage);

  Set<InternalDistributedMember> crashes = new HashSet<>();
  crashes.add(mockMembers[1]);
  crashes.add(mockMembers[2]);
  mbrs = new LinkedList<>(mbrs);
  mbrs.remove(mockMembers[1]);
  mbrs.remove(mockMembers[2]);
  NetView partitionView =
      new NetView(mockMembers[0], newView.getViewId() + 1, mbrs, Collections.emptySet(), crashes);
  installViewMessage = getInstallViewMessage(partitionView, credentials, false);
  gmsJoinLeave.processMessage(installViewMessage);

  verify(manager).forceDisconnect(isA(String.class));
  verify(manager).quorumLost(crashes, newView);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:35,代码来源:GMSJoinLeaveJUnitTest.java

示例13: getUses

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Set<UsesNode> getUses() {
    return Collections.emptySet();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:DataSchemaContainerProxy.java

示例14: MavenWhiteListQueryImpl

import java.util.Collections; //导入方法依赖的package包/类
public MavenWhiteListQueryImpl(Project prj) {
    project = prj;
    projectListener = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            //TODO listen just on changes of classpath??
            if (NbMavenProject.PROP_PROJECT.equals(evt.getPropertyName())) {
                synchronized (LOCK) {
                    Set<String> oldPrivate = cachePrivatePackages != null ? cachePrivatePackages.get() : null;
                    if (oldPrivate == null) {
                        oldPrivate = Collections.emptySet();
                    }
                    Set<String> oldTransitive = cacheTransitivePackages != null ? cacheTransitivePackages.get() : null;
                    if (oldTransitive == null) {
                        oldTransitive = Collections.emptySet();
                    }
                    isCached = false;
                    cacheOrLoad();
                    Set<String> newPrivate = cachePrivatePackages != null ? cachePrivatePackages.get() : null;
                    if (newPrivate == null) {
                        newPrivate = Collections.emptySet();
                    }
                    Set<String> newTransitive = cacheTransitivePackages != null ? cacheTransitivePackages.get() : null;
                    if (newTransitive == null) {
                        newTransitive = Collections.emptySet();
                    }
                    HashSet oldNotNew1 = new HashSet(oldPrivate);
                    oldNotNew1.removeAll(newPrivate);
                    HashSet newNotOld1 = new HashSet(newPrivate);
                    newNotOld1.removeAll(oldPrivate);
                    HashSet oldNotNew2 = new HashSet(oldTransitive);
                    oldNotNew2.removeAll(newTransitive);
                    HashSet newNotOld2 = new HashSet(newTransitive);
                    newNotOld2.removeAll(oldTransitive);
                    
                    boolean privateChanged = !oldNotNew1.isEmpty() || !newNotOld1.isEmpty();
                    boolean transitiveChanged = !oldNotNew2.isEmpty() || !newNotOld2.isEmpty();
                    if (privateChanged || transitiveChanged) {
                        ClassPath[] cps = project.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.SOURCE);
                        Set<FileObject> fos = new HashSet<FileObject>();
                        for (ClassPath cp : cps) {
                            fos.addAll(Arrays.asList(cp.getRoots()));
                        }
                        LOG.log(Level.INFO, "Refreshing indexes for {0} because {1}{2} changed.", new Object[]{project.getProjectDirectory(), privateChanged ? "accessible private packages, " : "", transitiveChanged ? "accessible transitive packages " : ""});
                        LOG.log(Level.FINE, "changes in private1-{0}", Arrays.toString(oldNotNew1.toArray()));
                        LOG.log(Level.FINE, "changes in private2-{0}", Arrays.toString(newNotOld1.toArray()));
                        LOG.log(Level.FINE, "changes in transitive1-{0}", Arrays.toString(oldNotNew2.toArray()));
                        LOG.log(Level.FINE, "changes in transitive2-{0}", Arrays.toString(newNotOld2.toArray()));
                        IndexingManager.getDefault().refreshAllIndices(fos.toArray(new FileObject[0]));
                    }
                }
            }
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:57,代码来源:MavenWhiteListQueryImpl.java

示例15: getLibraryPathIds

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Set<String> getLibraryPathIds() {
    return Collections.<String>emptySet();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:VisibilityChangeTest.java


注:本文中的java.util.Collections.emptySet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。