-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collections-699 PairingIterator #74
base: master
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!hasNext()) { | ||
throw new NoSuchElementException(); | ||
} | ||
final F firstValue = null != firstIterator && firstIterator.hasNext() ? firstIterator.next() : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line not needed ;-)
Thank you. I will check it, when i have time for it. at the moment im on vacation :) |
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?