本文整理了Java中org.openide.util.Union2.hasSecond()
方法的一些代码示例,展示了Union2.hasSecond()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Union2.hasSecond()
方法的具体详情如下:
包路径:org.openide.util.Union2
类名称:Union2
方法名:hasSecond
[英]Check if the union contains the second type.
[中]检查联合体是否包含第二种类型。
代码示例来源:origin: org.netbeans.api/org-openide-filesystems
if (resolvers != null && resolvers.hasSecond() && resolvers.second() == creators) {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
private ModelElement getModelElemnt() {
return element.hasSecond() ? element.second() : null;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-projectapi-nb
public boolean is(Union2<Reference<Project>,LoadStatus> o) {
return o != null && o.hasSecond() && o.second() == this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
@Override
public Collection<? extends String> getSuperClassNames() {
List<String> retval = new ArrayList<>();
if (superClass != null) {
String supeClsName = superClass.hasFirst() ? superClass.first() : null;
if (supeClsName != null) {
return Collections.singletonList(supeClsName);
}
List<ClassScopeImpl> supeClasses = Collections.emptyList();
if (superClass.hasSecond()) {
supeClasses = superClass.second();
}
for (ClassScopeImpl cls : supeClasses) {
retval.add(cls.getName());
}
}
return retval;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
@CheckForNull
private Collection<? extends TypeScope> typesFromUnion() {
if (typeNameScopes != null) {
if (typeNameScopes.hasSecond() && typeNameScopes.second() != null) {
return typeNameScopes.second();
}
}
return null;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-bootstrap
boolean clear = false;
for (Union2<Dependency,InvalidException> problem : s) {
if (problem.hasSecond()) {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
ModelElementImpl(Scope inScope, String name,
Union2<String/*url*/, FileObject> file, OffsetRange offsetRange, PhpElementKind kind,
PhpModifiers modifiers, boolean isDeprecated) {
if (name == null || file == null || kind == null || modifiers == null) {
throw new IllegalArgumentException("null for name | fo | kind: " + name + " | " + file + " | " + kind);
}
assert file.hasFirst() || file.hasSecond();
if (file.hasFirst() && file.first() != null) {
this.filenameUrl = file.first();
} else if (file.hasSecond() && file.second() != null) {
this.filenameUrl = file.second().toURL().toExternalForm();
} else {
this.filenameUrl = "";
}
this.inScope = inScope;
this.name = name;
this.offsetRange = offsetRange;
this.kind = kind;
this.file = file;
this.modifiers = modifiers;
this.isDeprecated = isDeprecated;
if (inScope instanceof ScopeImpl && !(this instanceof AssignmentImpl)/* && !(inScope instanceof IndexScope)*/) {
((ScopeImpl) inScope).addElement(this);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
@NonNull
@Override
public Collection<? extends ClassScope> getSuperClasses() {
List<ClassScope> retval = null;
if (superClass.hasSecond() && superClass.second() != null) {
return superClass.second();
}
assert superClass.hasFirst();
String superClasName = superClass.first();
if (possibleFQSuperClassNames != null && possibleFQSuperClassNames.size() > 0) {
retval = new ArrayList<>();
for (QualifiedName qualifiedName : possibleFQSuperClassNames) {
retval.addAll(IndexScopeImpl.getClasses(qualifiedName, this));
}
}
if (retval == null && superClasName != null) {
return IndexScopeImpl.getClasses(QualifiedName.create(superClasName), this);
}
return retval != null ? retval : Collections.<ClassScopeImpl>emptyList();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
static Model getModel(Union2<Document, FileObject> document2Parse) {
Parameters.notNull("document2Parse", document2Parse); //NOI18N
ModelProviderTask modelProvider = new ModelProviderTask();
if (document2Parse.hasFirst()) {
try {
Source source = Source.create(document2Parse.first());
ParserManager.parseWhenScanFinished(Collections.singleton(source), modelProvider);
} catch (ParseException e) {
LOG.log(Level.WARNING, null, e);
}
} else if (document2Parse.hasSecond()) {
Source source = Source.create(document2Parse.second());
try {
ParserManager.parseWhenScanFinished(Collections.singletonList(source), modelProvider);
} catch (ParseException ex) {
LOG.log(Level.WARNING, null, ex);
}
}
return modelProvider.getModel();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
assert false : name;
} else if (n.hasSecond()) {
PhpElement index = n.second();
if (index != null) {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
String typeNameFromUnion() {
if (typeNameScopes != null) {
if (typeNameScopes.hasFirst() && typeNameScopes.first() != null) {
return typeNameScopes.first();
} else if (typeNameScopes.hasSecond() && typeNameScopes.second() != null) {
TypeScope type = ModelUtils.getFirst(typeNameScopes.second());
return type != null ? type.getName() : null;
}
}
return null;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
@CheckForNull
@Override
public QualifiedName getSuperClassName() {
if (superClass != null) {
List<? extends ClassScope> retval = superClass.hasSecond() ? superClass.second() : null; //this
if (retval == null) {
assert superClass.hasFirst();
String superClasName = superClass.first();
if (superClasName != null) {
return QualifiedName.create(superClasName);
}
} else if (retval.size() > 0) {
ClassScope cls = ModelUtils.getFirst(retval);
if (cls != null) {
return QualifiedName.create(cls.getName());
}
}
}
return null;
}
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!