Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Collection Framework Question

 
Anant Jagania
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Why the Convenience implementations in Collection framework are known as High-performance "mini-implementation"?

It includes Arrays.asList, EMPTY_SET, EMPTY_List, EMPTY_MAP as well as singleton methods and nCopies.

Thanks & Regards,
Anant
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cute. I'd never seen those before. An immutable empty list could leave out a lot of implementation code since it doesn't have to add, retrieve or remove anything. I'd guess the "mini-implementation" has mostly empty methods or hard coded return values. I'm trying to imagine where I might use one ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic