public static Iterator iterator(final InstalledIdentity mgr, final PatchableTarget.TargetInfo info, boolean excludeAgedOut) { if(info == null) { throw new IllegalArgumentException("target info is null"); } return new IteratorImpl(info, mgr, excludeAgedOut); }
private static Entry next(final IteratorImpl i, IteratorState state) { String patchId = nextPatchIdForCurrentInfo(state); if(patchId == null) { // current info is exhausted, try moving to the next CP if(state.patchIndex < 0) { patchId = nextPatchIdForCurrentInfo(state); if(patchId == null) { throw new NoSuchElementException(PatchLogger.ROOT_LOGGER.noMorePatches()); assertExistsOnDisk(i, patchId);
return existsOnDisk(i, state.currentInfo.getPatchIDs().get(state.patchIndex)); return existsOnDisk(i, state.currentInfo.getCumulativePatchID()); return false; } else if(!existsOnDisk(i, nextInfo.getCumulativePatchID())) { return false;
private static Entry next(final IteratorImpl i, IteratorState state) { String patchId = nextPatchIdForCurrentInfo(state); if(patchId == null) { // current info is exhausted, try moving to the next CP if(state.patchIndex < 0) { patchId = nextPatchIdForCurrentInfo(state); if(patchId == null) { throw new NoSuchElementException(PatchLogger.ROOT_LOGGER.noMorePatches()); assertExistsOnDisk(i, patchId);
return existsOnDisk(i, state.currentInfo.getPatchIDs().get(state.patchIndex)); return existsOnDisk(i, state.currentInfo.getCumulativePatchID()); return false; } else if(!existsOnDisk(i, nextInfo.getCumulativePatchID())) { return false;
@Override public boolean hasNext() { return hasNext(this, this); }
@Override public Entry next() { return next(this, this); }
@Override public boolean hasNext() { return hasNext(this, this); }
@Override public Entry nextCP() { final IteratorState state = new IteratorState(currentInfo, patchIndex); final Entry entry = nextCP(this, state); if(entry == null) { throw new NoSuchElementException(PatchLogger.ROOT_LOGGER.noMorePatches()); } currentInfo = state.currentInfo; patchIndex = state.patchIndex; type = state.type; return entry; }
private static boolean existsOnDisk(IteratorImpl i, String id) { try { assertExistsOnDisk(i, id); return true; } catch(NoSuchElementException e) { return false; } }
@Override public Entry nextCP() { final IteratorState state = new IteratorState(currentInfo, patchIndex); final Entry entry = nextCP(this, state); if(entry == null) { throw new NoSuchElementException(PatchLogger.ROOT_LOGGER.noMorePatches()); } currentInfo = state.currentInfo; patchIndex = state.patchIndex; type = state.type; return entry; }
private static boolean existsOnDisk(IteratorImpl i, String id) { try { assertExistsOnDisk(i, id); return true; } catch(NoSuchElementException e) { return false; } }
@Override public boolean hasNextCP() { final IteratorState state = new IteratorState(currentInfo, patchIndex); return nextCP(this, state) != null; }
@Override public Entry next() { return next(this, this); }
public static Iterator iterator(final InstalledIdentity mgr, final PatchableTarget.TargetInfo info, boolean excludeAgedOut) { if(info == null) { throw new IllegalArgumentException("target info is null"); } return new IteratorImpl(info, mgr, excludeAgedOut); }
@Override public boolean hasNextCP() { final IteratorState state = new IteratorState(currentInfo, patchIndex); return nextCP(this, state) != null; }