• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confused on method signature collect in Stream inteface

 
Ranch Hand
Posts: 163
1
jQuery Eclipse IDE
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In Stream interface, the definition is as Stream<T> and the collec method is defined as:



What does R, A mean, how to interpret. I am facing difficulty in understanding the method definitions.

Thanks & Regards,

Swapna.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought that was an interesting question so I went to look at the API documentation for the Stream interface. And the method you asked about uses a Collector object, so finding out about Collector seemed like a good idea.

And when I clicked on the link I found that the documentation for Collector started out at the top with a description of those three type parameters. Did you find that?

(By the way, you posted this in one of the certification forums. Was that related to a particular certification exam? If not, let us know and a moderator will move it to a more suitable forum.)
Staff note (Paul Clapham) :

I moved the thread to the "Lambdas and Streams" forum.

 
Swapna latha
Ranch Hand
Posts: 163
1
jQuery Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul, will look into the API deeply.
 
Saloon Keeper
Posts: 15510
363
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On a tangent: In general you don't need to worry about the A parameter. You only need to care about it if you implement your own Collector.
 
Swapna latha
Ranch Hand
Posts: 163
1
jQuery Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:On a tangent: In general you don't need to worry about the A parameter. You only need to care about it if you implement your own Collector.


Thank you Stephan.
reply
    Bookmark Topic Watch Topic
  • New Topic