| 249 | } |
| 250 | |
| 251 | public 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 | /* |
| 280 | public static void main(String[] args){ |