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

MapStream methods #1788

Merged
merged 1 commit into from Sep 3, 2018

Conversation

Projects
None yet
3 participants
@wjnicholson
Contributor

wjnicholson commented Aug 24, 2018

  • Sorting by keys and by values
  • Maximum and minimum by keys and by values
MapStream methods
* Sorting by keys and values
* Maximum and minimum by keys and values
* @param comparator a comparator of keys
* @return the minimum entry
*/
public Optional<Map.Entry<K, V>> minKeys(Comparator<? super K> comparator) {

This comment has been minimized.

@cjkent

cjkent Aug 24, 2018

Member

Should this be called minKey (singular)?

This comment has been minimized.

@wjnicholson

wjnicholson Aug 28, 2018

Contributor

I was thinking it would be minKeys because you're taking the minimum by comparing the keys, whereas minKey makes me think that it will return the minimum key i.e Optional<K>

Happy to be wrong.

This comment has been minimized.

@jodastephen

jodastephen Aug 29, 2018

Member

I think the name is fine as is, I just struggle to think that these four min/max methods would actually be used.

This comment has been minimized.

@wjnicholson

wjnicholson Sep 3, 2018

Contributor

Ah, I wanted to use them, that's why I thought of them.

* @param comparator a comparator of values
* @return the minimum entry
*/
public Optional<Map.Entry<K, V>> minValues(Comparator<? super V> comparator) {

This comment has been minimized.

@cjkent

cjkent Aug 24, 2018

Member

minValue?

* @param comparator a comparator of keys
* @return the maximum entry
*/
public Optional<Map.Entry<K, V>> maxKeys(Comparator<? super K> comparator) {

This comment has been minimized.

@cjkent

cjkent Aug 24, 2018

Member

maxKey?

* @param comparator a comparator of values
* @return the maximum entry
*/
public Optional<Map.Entry<K, V>> maxValues(Comparator<? super V> comparator) {

This comment has been minimized.

@cjkent

cjkent Aug 24, 2018

Member

maxValue?

* @param comparator a comparator of keys
* @return the minimum entry
*/
public Optional<Map.Entry<K, V>> minKeys(Comparator<? super K> comparator) {

This comment has been minimized.

@jodastephen

jodastephen Aug 29, 2018

Member

I think the name is fine as is, I just struggle to think that these four min/max methods would actually be used.

@wjnicholson wjnicholson merged commit 7a5734b into master Sep 3, 2018

15 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
security/snyk - modules/basics/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/calc/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/collect/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/data/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/loader/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/market/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/math/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/measure/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/pricer/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/product/pom.xml (OpenGamma) No new issues
Details
security/snyk - modules/report/pom.xml (OpenGamma) No new issues
Details
security/snyk - pom.xml (OpenGamma) No new issues
Details

@wjnicholson wjnicholson deleted the topic/MapStream-max-sorted branch Sep 3, 2018

@jodastephen jodastephen added this to the v2.1 milestone Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment