Collection Framework Introduction

//Collection Framework Introduction

Collection Framework :

It defines several Classes and Interfaces to represent group of objects as single entity. In this tutorial I want to give just high end overview of Java Collection Framework. Further tutorials in this sections explains more details about Collection Interfaces and Classes of collection Framework.

I divided Collection Framework into several sections to understand more clearly. They are :

  1. List Types
  2. Set Types
  3. Queue Types
  4. Map Types
  5. Cursors
  6. Utility Classes and Interfaces

Below image illustrates more about these parts.

1. List Types :

In this section you will find List types (Interfaces and Classes) of Collections.

 What are List types ? –

  1. List types represents  group of individual objects as single entity.
  2. Preserves the insertion order. (The order of elements while saving and and the order of elements while retrieving is same).
  3. Duplicate element insertion is possible.

2. Set Types:

In this section you will find Set types (Interfaces and Classes) of Collections.

 What are Set types ? –

  1. Set types represents  group of individual objects as single entity.
  2. Insertion order not preserved. (The order of elements while saving and and the order of elements while retrieving is not same).
  3. Duplicate element insertion is not possible.

3. Queue Types :

In this section you will find Queue types (Interfaces and Classes) of Collections.

 What are Queue types ? –

  1. Queue types represents  group of individual objects as single entity.
  2. A queue supports the insert and remove operations using a FIFO (First-In-First-Out) discipline.
  3. A queue is designed to have elements inserted at the end of the queue, and elements removed from the beginning of the queue.
  4. By convention, we name the queue insert operation enqueue and the remove operation dequeue.

4. Map Types :

In this section you will find Map types (Interfaces and Classes) of Collections.

 What are Map types ? –

  1. Map types represents  group of objects as single entity.
  2. Represent each element as key value pair, and that key value pair called Entry.
  3. Map is a group of Entries.
  4. For example, List types and Set types stores student names as elements. So each student name is one element in Set type or List type objects. But if want to store student roll number and student name in each element in List types and Set types it’s not possible. We have to use Map type, in a Map each element (here it’s called Entry) is a key value pair. So key as roll number and value as Student name we can give, then Map type represents group of key value pairs (Entries).

5. Cursors :

In this section you will find Cursors of Collections. Cursors are Interfaces.

 What is Cursor in Collection Framework ? –

  1. A Cursor is used to retrieve collection elements one by one.
  2. For Example Iterator, it is used to retrieve elements from List types and Set types.

I will discuss about all Cursor Interfaces in further sections.

6. Utility Classes and Interfaces :

In this section you will find Utility classes and Interfaces  of Collections.

 Utility classes and Interfaces in Collection Framework –

  1. Collection Framework provides some utility classes and interfaces to Sort a Collection object, to Search over Collection elements, to change order of elements, to convert Collection types to Array types and Array types to Collection types.

I will discuss more about each Utility Class and Interface in Further tutorials.

In this tutorial I have not introduced any of Class or Interface of Collection Framework. This tutorial is just High End overview of Collection Framework. Further tutorials explains the major Collection Classes and Interfaces in depth.
2017-08-31T12:41:00+00:00Categories: core java|Tags: , |0 Comments

Leave A Comment