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

A question about the Collection interfaces #1974

Closed
landawn opened this issue May 3, 2017 · 5 comments
Closed

A question about the Collection interfaces #1974

landawn opened this issue May 3, 2017 · 5 comments
Labels
Milestone

Comments

@landawn
Copy link

landawn commented May 3, 2017

I see there are a lot of common methods defined in List/Set/Queue/Array/... and wondering why there is no a common interface to abstract the common methods to make the interfaces more concise/consistent?

@danieldietrich
Copy link
Contributor

There are common interfaces LinearSeq and IndexedSeq - and on top of them Seq and Traversable.

Which methods do you mean for example?

@danieldietrich danieldietrich added this to the vavr-0.9.0 milestone May 3, 2017
@landawn
Copy link
Author

landawn commented May 3, 2017

For example, filter/map/flatMap/distinct/top/... Can these methods be defined/implemented in a basic abstract class? or move them to a separated interface, like Steam API to Collection in java.util?

@danieldietrich
Copy link
Contributor

We have already package-private classes for that purpose in io.vavr.collection, e.g. Collections, Maps, Multimaps, Comparators, AbstractMultimap and AbstractQueue. But I think there is potential to further simplify things.

However, please note that there is a JDK bug, that prevents us from using method references when we use package-private abstract classes. See #1326

@danieldietrich
Copy link
Contributor

I will close this ticket. Improvements are ongoing progress.

@landawn
Copy link
Author

landawn commented May 8, 2017

Ok, thanks

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

No branches or pull requests

2 participants