ceylon.language.serialization.ReferencesImpl.ceylon Maven / Gradle / Ivy
import ceylon.language.impl{
BaseIterator,
BaseIterable,
reach
}
class ReferencesImpl(instance) extends BaseIterableAnything, Null>()
satisfies References&Identifiable {
shared actual Anything instance;
shared actual IteratorAnything> iterator() {
if (exists instance) {
return object extends BaseIteratorAnything>()
satisfies Identifiable {
Iterator it = outer.references.iterator();
shared actual Anything>|Finished next() {
ReachableReference|Finished next = it.next();
if (is Finished next) {
return finished;
} else {
return next->next.referred(instance);
}
}
};
} else {
return emptyIterator;
}
}
shared actual Iterable*/> references {
return object extends BaseIterable()
satisfies Identifiable {
shared actual Iterator iterator() {
return reach.references(instance);
}
};
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy