CompoundIterator.java
723 Bytes
/*
* Decompiled with CFR 0_118.
*/
package com.day.util;
import java.util.Iterator;
public class CompoundIterator
implements Iterator {
private final Iterator parent;
private final Iterator child;
public CompoundIterator(Iterator parent, Iterator child) {
this.parent = parent;
this.child = child;
}
public boolean hasNext() {
return this.parent.hasNext() || this.child.hasNext();
}
public Object next() {
return this.parent.hasNext() ? this.parent.next() : this.child.next();
}
public void remove() throws UnsupportedOperationException {
throw new UnsupportedOperationException("remove() is not supported in CompoundInterator");
}
}