Skip to content
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

Implemented the 'elementAt' and 'elementAtOrDefault' operators. see #41 #390

Merged
merged 1 commit into from
Sep 21, 2013

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Sep 18, 2013

Hi,

This implements the ElementAt and ElementAtOrDefault operators from #41.

For ElementAt, if the index is less than 0, or greater than or equal to the number of elements in the source sequence, an IndexOutOfBoundsException will be threw.

For ElementAtOrDefault, if the index is less than 0, an IndexOutOfBoundsException will be threw. What's more, I added a defaultValue parameter. I can not get the element type in the source observable due to type erasure. So I can not determine the default value automatically. That's why ElementAtOrDefault needs a defaultValue parameter.

@cloudbees-pull-request-builder

RxJava-pull-requests #288 SUCCESS
This pull request looks good

benjchristensen added a commit that referenced this pull request Sep 21, 2013
@benjchristensen benjchristensen merged commit 5df8e3c into ReactiveX:master Sep 21, 2013
@benjchristensen
Copy link
Member

Thank you @zsxwing

@zsxwing zsxwing deleted the element_at branch September 23, 2013 11:14
rickbw pushed a commit to rickbw/RxJava that referenced this pull request Jan 9, 2014
jihoonson pushed a commit to jihoonson/RxJava that referenced this pull request Mar 6, 2020
* retry reactor ReactiveX#383

* retry reactor ReactiveX#383

* review comments

* javadoc update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants