public boolean hasNext() { if(this.currentVersionableItem == null) { return false; } if(this.iterationType == ITERATION_TYPE_SUCCESSOR) { return (this.currentVersionableItem.getSucceedingVersion() != null); } else if(this.iterationType == ITERATION_TYPE_PREDECESSOR) { return (this.currentVersionableItem.getPrecedingVersion() != null); } else { //shouldn't reach this block log.error("Reached unexpected path of execution because iterationType is set to: " + this.iterationType); return false; } }
public boolean hasNext() { if(this.currentVersionableItem == null) { return false; } if(this.iterationType == ITERATION_TYPE_SUCCESSOR) { return (this.currentVersionableItem.getSucceedingVersion() != null); } else if(this.iterationType == ITERATION_TYPE_PREDECESSOR) { return (this.currentVersionableItem.getPrecedingVersion() != null); } else { //shouldn't reach this block log.error("Reached unexpected path of execution because iterationType is set to: " + this.iterationType); return false; } }
public Object next() { if(this.iterationType == ITERATION_TYPE_SUCCESSOR) { this.currentVersionableItem = this.currentVersionableItem.getSucceedingVersion(); } else if(this.iterationType == ITERATION_TYPE_PREDECESSOR) { this.currentVersionableItem = this.currentVersionableItem.getPrecedingVersion(); } else { //shouldn't reach this block log.error("Reached unexpected path of execution because iterationType is set to: " + this.iterationType); return null; } if(this.currentVersionableItem == null) { throw new NoSuchElementException(); } return this.currentVersionableItem; }
public Object next() { if(this.iterationType == ITERATION_TYPE_SUCCESSOR) { this.currentVersionableItem = this.currentVersionableItem.getSucceedingVersion(); } else if(this.iterationType == ITERATION_TYPE_PREDECESSOR) { this.currentVersionableItem = this.currentVersionableItem.getPrecedingVersion(); } else { //shouldn't reach this block log.error("Reached unexpected path of execution because iterationType is set to: " + this.iterationType); return null; } if(this.currentVersionableItem == null) { throw new NoSuchElementException(); } return this.currentVersionableItem; }