This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Utils Question

 
Steven Wong
Ranch Hand
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Some of the operations in the collection interfaces are optional, meaning that the
implementing class may choose not to provide a proper implementation of such an operation.
In such a case, an UnsupportedOperationException is thrown when that operation is invoked.

Question is, how do I know which of the classes provide proper implementations of which operations?
Thanks,
Clement
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think all the classes in the API provide implemtations for everything.
if you make your own classes then you can choose not to implement every method in the interface.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Close but not 100% correct. Read the Javadoc for AbstractCollection and AbstractMap; that will give you a pretty idea of how the java.util classes are implemented. The class comments for AbstractMap in particular suggest some limitations in what might be implemented.
 
Jose Botella
Ranch Hand
Posts: 2120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roy very, very close.
All the classes in the API that have an implementation provide for the optional methods.
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i stand corrected
thanks for correcting me guys.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic