@Override public void remove() { nextIndex = prevIndex; // restore previous state storageDirs.remove(prevIndex); // remove last returned element hasNext(); // reset nextIndex to correct place }
@Override public boolean hasNext() { if (storageDirs.isEmpty() || nextIndex >= storageDirs.size()) return false; if (dirType != null || !includeShared) { while (nextIndex < storageDirs.size()) { if (shouldReturnNextDir()) break; nextIndex++; } if (nextIndex >= storageDirs.size()) return false; } return true; }
@Override public boolean hasNext() { if (storageDirs.isEmpty() || nextIndex >= storageDirs.size()) return false; if (dirType != null || !includeShared) { while (nextIndex < storageDirs.size()) { if (shouldReturnNextDir()) break; nextIndex++; } if (nextIndex >= storageDirs.size()) return false; } return true; }
@Override public boolean hasNext() { if (storageDirs.isEmpty() || nextIndex >= storageDirs.size()) return false; if (dirType != null || !includeShared) { while (nextIndex < storageDirs.size()) { if (shouldReturnNextDir()) break; nextIndex++; } if (nextIndex >= storageDirs.size()) return false; } return true; }
@Override public StorageDirectory next() { StorageDirectory sd = getStorageDir(nextIndex); prevIndex = nextIndex; nextIndex++; if (dirType != null || !includeShared) { while (nextIndex < storageDirs.size()) { if (shouldReturnNextDir()) break; nextIndex++; } } return sd; }
@Override public StorageDirectory next() { StorageDirectory sd = getStorageDir(nextIndex); prevIndex = nextIndex; nextIndex++; if (dirType != null || !includeShared) { while (nextIndex < storageDirs.size()) { if (shouldReturnNextDir()) break; nextIndex++; } } return sd; }
public void remove() { nextIndex = prevIndex; // restore previous state storageDirs.remove(prevIndex); // remove last returned element hasNext(); // reset nextIndex to correct place } }
/** * @param dirType all entries will be of this type of dir * @param includeShared true to include any shared directories, * false otherwise * @return an iterator over the configured storage dirs. */ public Iterator<StorageDirectory> dirIterator(StorageDirType dirType, boolean includeShared) { return new DirIterator(dirType, includeShared); }
/** * Return iterator based on Storage Directory Type * This iterator selects entires of storageDirs of type dirType and returns * them via the Iterator */ public Iterator<StorageDirectory> dirIterator(StorageDirType dirType) { return new DirIterator(dirType); }
@Override public void remove() { nextIndex = prevIndex; // restore previous state storageDirs.remove(prevIndex); // remove last returned element hasNext(); // reset nextIndex to correct place }
/** * Return iterator based on Storage Directory Type * This iterator selects entires of storageDirs of type dirType and returns * them via the Iterator */ public Iterator<StorageDirectory> dirIterator(StorageDirType dirType) { return new DirIterator(dirType); }
@Override public void remove() { nextIndex = prevIndex; // restore previous state storageDirs.remove(prevIndex); // remove last returned element hasNext(); // reset nextIndex to correct place }
public void remove() { nextIndex = prevIndex; // restore previous state storageDirs.remove(prevIndex); // remove last returned element hasNext(); // reset nextIndex to correct place } }
/** * @param dirType all entries will be of this type of dir * @param includeShared true to include any shared directories, * false otherwise * @return an iterator over the configured storage dirs. */ public Iterator<StorageDirectory> dirIterator(StorageDirType dirType, boolean includeShared) { return new DirIterator(dirType, includeShared); }
@Override public StorageDirectory next() { StorageDirectory sd = getStorageDir(nextIndex); prevIndex = nextIndex; nextIndex++; if (dirType != null || !includeShared) { while (nextIndex < storageDirs.size()) { if (shouldReturnNextDir()) break; nextIndex++; } } return sd; }
/** * @param dirType all entries will be of this type of dir * @param includeShared true to include any shared directories, * false otherwise * @return an iterator over the configured storage dirs. */ public Iterator<StorageDirectory> dirIterator(StorageDirType dirType, boolean includeShared) { return new DirIterator(dirType, includeShared); }