use of ceylon.language.impl.BaseIterable in project ceylon by eclipse.
the class Array method locations.
@Override
@TypeInfo("{ceylon.language::Entry<ceylon.language::Integer,Element>*}")
public Iterable<? extends Entry<? extends Integer, ? extends Element>, ? extends java.lang.Object> locations(@Name("selecting") @FunctionalParameter("(element)") @TypeInfo("ceylon.language::Boolean(Element&ceylon.language::Object)") final Callable<? extends Boolean> selecting) {
final TypeDescriptor klass = TypeDescriptor.klass(Entry.class, Integer.$TypeDescriptor$, $reifiedElement);
return new BaseIterable<Entry<? extends Integer, ? extends Element>, java.lang.Object>(klass, Null.$TypeDescriptor$) {
@Override
public Iterator<? extends Entry<? extends Integer, ? extends Element>> iterator() {
return new BaseIterator<Entry<? extends Integer, ? extends Element>>(klass) {
int index = 0;
@Override
public java.lang.Object next() {
while (index < size) {
Element element = unsafeItem(index);
if (selecting.$call$(element).booleanValue()) {
return new Entry(Integer.$TypeDescriptor$, $reifiedElement, Integer.instance(index++), element);
}
index++;
}
return finished_.get_();
}
};
}
};
}
Aggregations