use of org.eclipse.ceylon.compiler.java.runtime.metamodel.decl.NestableDeclarationImpl in project ceylon by eclipse.
the class ClassOrInterfaceDeclarationImpl method filteredDeclaredMembers.
@SuppressWarnings({ "rawtypes", "unchecked" })
private <Kind> Sequential<? extends Kind> filteredDeclaredMembers(@Ignore TypeDescriptor $reifiedKind, Predicates.Predicate predicate) {
if (predicate == Predicates.false_()) {
return (Sequential<? extends Kind>) empty_.get_();
}
checkInit();
ArrayList<Kind> members = new ArrayList<Kind>(declarations.size());
for (ceylon.language.meta.declaration.NestableDeclaration decl : declaredDeclarations) {
Declaration declaration2 = ((NestableDeclarationImpl) decl).declaration;
if (!declaration2.isNativeHeader() && predicate.accept(declaration2)) {
members.add((Kind) decl);
}
}
java.lang.Object[] array = members.toArray(new java.lang.Object[0]);
ObjectArrayIterable<Kind> iterable = new ObjectArrayIterable<Kind>($reifiedKind, (Kind[]) array);
return (ceylon.language.Sequential) iterable.sequence();
}
use of org.eclipse.ceylon.compiler.java.runtime.metamodel.decl.NestableDeclarationImpl in project ceylon by eclipse.
the class ClassOrInterfaceDeclarationImpl method filteredMembers.
@SuppressWarnings({ "rawtypes", "unchecked" })
private <Kind> Sequential<? extends Kind> filteredMembers(@Ignore TypeDescriptor $reifiedKind, Predicates.Predicate predicate) {
if (predicate == Predicates.false_()) {
return (Sequential<? extends Kind>) empty_.get_();
}
checkInit();
ArrayList<Kind> members = new ArrayList<Kind>(declarations.size());
for (ceylon.language.meta.declaration.NestableDeclaration decl : declarations) {
Declaration declaration2 = ((NestableDeclarationImpl) decl).declaration;
if (!declaration2.isNativeHeader() && predicate.accept(declaration2)) {
members.add((Kind) decl);
}
}
java.lang.Object[] array = members.toArray(new java.lang.Object[0]);
ObjectArrayIterable<Kind> iterable = new ObjectArrayIterable<Kind>($reifiedKind, (Kind[]) array);
return (ceylon.language.Sequential) iterable.sequence();
}
Aggregations