本文整理了Java中org.openide.util.Union2.createSecond()
方法的一些代码示例,展示了Union2.createSecond()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Union2.createSecond()
方法的具体详情如下:
包路径:org.openide.util.Union2
类名称:Union2
方法名:createSecond
[英]Construct a union based on the second type.
[中]基于第二种类型构造一个并集。
代码示例来源:origin: org.netbeans.api/org-openide-filesystems
resolvers = Union2.createSecond(creators);
代码示例来源:origin: org.netbeans.api/org-openide-util
invoked.set(true);
} catch (InterruptedException e) {
res.set(Union2.<T,Throwable>createSecond(e));
} catch (InvocationTargetException e) {
res.set(Union2.<T,Throwable>createSecond(e));
代码示例来源:origin: org.netbeans.api/org-openide-util-ui
invoked.set(true);
} catch (InterruptedException e) {
res.set(Union2.<T,Throwable>createSecond(e));
} catch (InvocationTargetException e) {
res.set(Union2.<T,Throwable>createSecond(e));
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-projectapi-nb
public Union2<Reference<Project>,LoadStatus> wrap() {
return Union2.createSecond(this);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
public ElementInfo(ModelElement element) {
this.element = Union2.createSecond(element);
if (element instanceof Scope) {
scope = (Scope) element;
} else {
scope = element.getInScope();
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
public AttributedElement enterWrite(String name, Kind k, PhpElement el) {
return enterWrite(name, k, Union2.<ASTNode, PhpElement>createSecond(el), null);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui
private void processChildren() {
if (children == null) {
return;
}
List<Node> nodeList = children.first();
assert !nodeList.isEmpty();
Node[] nodesArray = children.first().toArray(
new Node[nodeList.size()]);
children = Union2.<List<Node>,Node[]>createSecond(nodesArray);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-maven-repository
@Override protected boolean createKeys(List<Union2<RepositoryInfo,QueryRequest>> toPopulate) {
for (RepositoryInfo info : RepositoryPreferences.getInstance().getRepositoryInfos()) {
toPopulate.add(Union2.<RepositoryInfo,QueryRequest>createFirst(info));
}
synchronized (searches) {
for (QueryRequest search : searches) {
toPopulate.add(Union2.<RepositoryInfo,QueryRequest>createSecond(search));
}
}
return true;
}
@Override protected Node createNodeForKey(Union2<RepositoryInfo,QueryRequest> key) {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui
private static void processNodes(Union2<List<Node>,Node[]> unionNodes[]) {
for (int i = 0; i < unionNodes.length; i++) {
Union2<List<Node>,Node[]> node = unionNodes[i];
if (node == null) {
continue;
}
List<Node> nodeList = node.first();
assert !nodeList.isEmpty();
Node[] nodesArray = node.first().toArray(
new Node[nodeList.size()]);
for (Node nodeArrayElem : nodesArray) {
nodeArrayElem.processChildren();
}
unionNodes[i] = Union2.<List<Node>,Node[]>createSecond(nodesArray);
assert unionNodes[i].second().length != 0;
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project
public static DebugStarter getInstance() {
boolean init;
synchronized (DebugStarterFactory.class) {
init = (INSTANCE == null);
}
if (init) {
//TODO add lookup listener
DebugStarter debugStarter = Lookup.getDefault().lookup(DebugStarter.class);
if (debugStarter != null) {
INSTANCE = Union2.createFirst(debugStarter);
} else {
INSTANCE = Union2.createSecond(Boolean.FALSE);
}
}
return INSTANCE.hasFirst() ? INSTANCE.first() : null;
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl
private <T extends FileComponent> Union2<T, WeakContainer<T>> asUnion(CsmValidable stateOwner, T fc, boolean persistent) {
if (persistent) {
return Union2.createSecond(new WeakContainer<T>(stateOwner, fc.getKey()));
} else {
return Union2.createFirst(fc);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-rakeproject
return Union2.createFirst(val.toString());
} else {
return Union2.createSecond(needed);
return Union2.createFirst(val.toString());
} else {
return Union2.createSecond(needed);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
private FileScopeImpl(PHPParseResult info, String name) {
super(
null,
name,
Union2.<String, FileObject>createSecond(info != null ? info.getSnapshot().getSource().getFileObject() : null),
new OffsetRange(0, 0),
PhpElementKind.PROGRAM,
false);
this.info = info;
}
代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util
invoked.set(true);
} catch (InterruptedException e) {
res.set(Union2.<T,Throwable>createSecond(e));
} catch (InvocationTargetException e) {
res.set(Union2.<T,Throwable>createSecond(e));
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl
FileDeclarationsKey fileDeclarationsKey = new FileDeclarationsKey(input);
assert fileDeclarationsKey != null : "file declaratios key can not be null";
fileComponentDeclarations = Union2.createSecond(new WeakContainer<FileComponentDeclarations>(project, fileDeclarationsKey));
fileComponentIncludes = Union2.createSecond(new WeakContainer<FileComponentIncludes>(project, fileIncludesKey));
hasBrokenIncludes = new AtomicBoolean(input.readBoolean());
fileComponentMacros = Union2.createSecond(new WeakContainer<FileComponentMacros>(project, fileMacrosKey));
fileComponentReferences = Union2.createSecond(new WeakContainer<FileComponentReferences>(project, fileReferencesKey));
fileComponentInstantiations = Union2.createSecond(new WeakContainer<FileComponentInstantiations>(project, fileInstantiationsKey));
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
public Collection<? extends TypeScope> getTypes() {
List<? extends TypeScope> empty = Collections.emptyList();
Collection<? extends TypeScope> types = typesFromUnion();
if (types != null) {
return types;
}
String tName = typeNameFromUnion();
if (tName != null) {
//StackOverflow prevention
if (canBeProcessed(tName)) {
types = VariousUtils.getType((VariableScope) getInScope(), tName, getOffset(), false);
}
}
if (types != null) {
if (types.isEmpty() && tName != null && !VariousUtils.isSemiType(tName)) {
return empty;
}
typeNameScopes = Union2.<String, Collection<? extends TypeScope>>createSecond(types);
return types;
} else {
typeNameScopes = null;
}
return empty;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
IncludeElementImpl(Scope inScope, IncludeInfo info) {
super(
inScope,
"include", //NOI18N
Union2.<String, FileObject>createSecond(inScope.getFileObject()),
new OffsetRange(0, 0),
info.getPhpElementKind(),
PhpModifiers.noModifiers(),
false);
this.fileName = info.getFileName();
this.referenceSpanRange = info.getRange();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
private IndexScopeImpl(PHPParseResult info, String name, PhpElementKind kind) {
super(
null,
name,
Union2.<String, FileObject>createSecond(info != null ? info.getSnapshot().getSource().getFileObject() : null),
new OffsetRange(0, 0),
kind,
false);
assert info != null;
this.model = info.getModel();
this.index = IndexQueryImpl.create(QuerySupportFactory.get(info), this.model);
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base
res = profile != null ?
Union2.<Profile,String>createFirst(profile) :
Union2.<Profile,String>createSecond(profileName);
if (key != null) {
ac.putProfile(key, res);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
@CheckForNull
@Override
public FileObject getFileObject() {
FileObject fileObject = null;
synchronized (ModelElementImpl.class) {
if (file != null) {
fileObject = file.hasSecond() ? file.second() : null;
}
}
if (fileObject == null && file.hasFirst()) {
String fileUrl = file.first();
if (StringUtils.hasText(fileUrl)) {
fileObject = PhpElementImpl.resolveFileObject(fileUrl);
synchronized (ModelElementImpl.class) {
if (fileObject != null) {
file = Union2.createSecond(fileObject);
}
}
}
}
return fileObject;
}
内容来源于网络,如有侵权,请联系作者删除!