MCPcopy Index your code
hub / github.com/clojure/clojure / iterator

Method iterator

src/jvm/clojure/lang/PersistentQueue.java:251–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

249}
250
251public Iterator iterator(){
252 return new Iterator(){
253 private ISeq fseq = f;
254 private final Iterator riter = r != null ? r.iterator() : null;
255
256 public boolean hasNext(){
257 return ((fseq != null && fseq.seq() != null) || (riter != null && riter.hasNext()));
258 }
259
260 public Object next(){
261 if(fseq != null)
262 {
263 Object ret = fseq.first();
264 fseq = fseq.next();
265 return ret;
266 }
267 else if(riter != null && riter.hasNext())
268 return riter.next();
269 else
270 throw new NoSuchElementException();
271 }
272
273 public void remove(){
274 throw new UnsupportedOperationException();
275 }
276 };
277}
278
279/*
280public static void main(String[] args){

Callers

nothing calls this directly

Calls 1

iteratorMethod · 0.65

Tested by

no test coverage detected