/** * Returns the next element in the iteration. * * @return the next element in the iteration. * @see FilterIterator.Filter#accept */ public E next() { if (hasNext()) { current = next; // Make sure we advance next time next = null; return current; } else { throw new NoSuchElementException("Iteration has no more elements."); } }
private void appendTextEntriesFlat(final IIOMetadataNode node, final Directory directory, final FilterIterator.Filter<Entry> filter) { FilterIterator<Entry> entries = new FilterIterator<>(directory.iterator(), filter); while (entries.hasNext()) { Entry entry = entries.next(); if (entry.getValue() instanceof Directory) { appendTextEntriesFlat(node, (Directory) entry.getValue(), filter); } else if (entry.getValue() instanceof String) { IIOMetadataNode tag = new IIOMetadataNode("TextEntry"); String fieldName = entry.getFieldName(); if (fieldName != null) { tag.setAttribute("keyword", fieldName); } else { // NOTE: This should never happen, as we filter out only specific nodes tag.setAttribute("keyword", String.format("%s", entry.getIdentifier())); } tag.setAttribute("value", entry.getValueAsString()); node.appendChild(tag); } } }
/** * Returns the next element in the iteration. * * @return the next element in the iteration. * @see FilterIterator.Filter#accept */ public E next() { if (hasNext()) { mCurrent = mNext; // Make sure we advance next time mNext = null; return mCurrent; } else { throw new NoSuchElementException("Iteration has no more elements."); } }
/** * Returns the next element in the iteration. * * @return the next element in the iteration. * @see FilterIterator.Filter#accept */ public E next() { if (hasNext()) { current = next; // Make sure we advance next time next = null; return current; } else { throw new NoSuchElementException("Iteration has no more elements."); } }
/** * Returns the next element in the iteration. * * @return the next element in the iteration. * @see FilterIterator.Filter#accept */ public E next() { if (hasNext()) { current = next; // Make sure we advance next time next = null; return current; } else { throw new NoSuchElementException("Iteration has no more elements."); } }
private void appendTextEntriesFlat(final IIOMetadataNode node, final Directory directory, final FilterIterator.Filter<Entry> filter) { FilterIterator<Entry> entries = new FilterIterator<>(directory.iterator(), filter); while (entries.hasNext()) { Entry entry = entries.next(); if (entry.getValue() instanceof Directory) { appendTextEntriesFlat(node, (Directory) entry.getValue(), filter); } else if (entry.getValue() instanceof String) { IIOMetadataNode tag = new IIOMetadataNode("TextEntry"); String fieldName = entry.getFieldName(); if (fieldName != null) { tag.setAttribute("keyword", fieldName); } else { // NOTE: This should never happen, as we filter out only specific nodes tag.setAttribute("keyword", String.format("%s", entry.getIdentifier())); } tag.setAttribute("value", entry.getValueAsString()); node.appendChild(tag); } } }