Monday, 2 January 2012

Collection Framework

9 key Interfaces of collection framework:
                                              
  • Collection
  •  Set
  •  List 
  •  SortedSet
  • NavigableSet
  • Queue
  • Map
  • SortedMap 
  • NavigableMap
Collection:
               If we want  represent a group of    individual objects  as a single entity then we should go for Collections

In general we can consider Collection as root interface of entire Collection FrameWork

Collection interface defines the most common methods which can be applicable for any Collection object
List:
              It is the child interface of collection.If we want to represent a group of individual objects  as single entity where duplicates are allowed and insertion order must be preserved then we should  go for  List interface
Set:
     It is child Interface of Collection.If we want represent a group of individual  objects as single entity where duplicates are not allowed and insertion order is not preserved .then we should go for Set interface
SortedSet:

      It is child interface of set .if we want represent a group of unique objects according to some sorting order then we should go for SortedSet  .

NavigableSet:

     It is child Interface of SortedSet.It provide several methods for Navigation purpose.




Queue:
     
It is child Interface of Collection.If we want  represent a group of    individual objects  priority processing   then we should   go for Queue concepts

Map:
         Map is not child interface of Collection.If we want represent a group of objects key and value pairs then we should go for Map.

Duplicate keys are not allowed but values can be duplicated



SortedMap:
                  
                               It is child Interface of Map..If we want represent a group of objects key and value pairs according to some sorting order then we should go for Sorted Map.



NavigableMap:

                      It is child Interface of SortedMap.It provide several methods for Navigation purpose.
     



















































No comments:

Post a Comment