Collections-699 PairingIterator#74
Open
Fival85 wants to merge 6 commits into
Open
Conversation
[NEW] An iterator for returning pairs of the childs iterators, askes in COLLECTIONS-699
[FIXED] replacing tabs with whitespaces
Instead of a common-lang Pair we use a custom lightweight dto.
spaces instead of tabs
Change dependency scope of commons-lang3 back to "test"
unit tests for equals and toString of the dto entry
garydgregory
requested changes
Jul 5, 2019
| if (!hasNext()) { | ||
| throw new NoSuchElementException(); | ||
| } | ||
| final F firstValue = null != firstIterator && firstIterator.hasNext() ? firstIterator.next() : null; |
Member
There was a problem hiding this comment.
It does not seem necessary to call each delegate iterator's hasNext() method since this method just invoked its own hasNext().
In general, this begs the question of what thread-safety guarantees this class makes. If none, the Javadocs should say so.
| * If one iterator has more elements then the other, the result {@link Entry} | ||
| * will contain a null value and the value of the not empty child iterator until | ||
| * both of the iterator exhausted. | ||
| * |
Member
There was a problem hiding this comment.
You are missing a close tag for 'p' here.
| * both of the iterator exhausted. | ||
| * | ||
| * @param <F> type of first value. The first value of {@link Entry} | ||
| * |
Member
There was a problem hiding this comment.
This blank line is not needed.
| * @param <F> the type of the first element | ||
| * @param <S> the type of the second element | ||
| */ | ||
| public static class Entry<F, S> { |
Member
There was a problem hiding this comment.
This is not needed if you reuse one of:
org.apache.commons.collections4.keyvalue.DefaultKeyValue<K, V>org.apache.commons.collections4.keyvalue.DefaultMapEntry<K, V>org.apache.commons.collections4.keyvalue.MultiKey<K>
|
|
||
| /** | ||
| * Unit test suite for {@link PairingIterator}. | ||
| * |
Author
|
Thank you. I will check it, when i have time for it. at the moment im on vacation :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello again,
like in #73 here is the second try to implement COLLECTIONS-699
Now i use a standalone lightweight dto inside the PairingIterator to return the result.
Is the implementation ok?