本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
}
示例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);
}
示例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);
}
示例13: getUses
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Set<UsesNode> getUses() {
return Collections.emptySet();
}
示例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]));
}
}
}
}
};
}
示例15: getLibraryPathIds
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Set<String> getLibraryPathIds() {
return Collections.<String>emptySet();
}