Collections framework (Usages)- For selenium

What is a Collections Framework?

A collections framework is a unified architecture for representing and manipulating collections.All collections frameworks contain the following:

  • Interfaces: These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy.
  • Implementations: These are the concrete implementations of the collection interfaces. In essence, they are reusable data structures.

Benefits of the Java Collections Framework

The Java Collections Framework provides the following benefits:

  1. Reduces programming effort by providing data structures and algorithms so you don’t have to write them yourself.
  2. Increases performance by providing high-performance implementations of data structures and algorithms. Because the various implementations of each interface are interchangeable, programs can be tuned by switching implementations.
  3. Provides interoperability between unrelated APIs by establishing a common language to pass collections back and forth.
  4. Reduces the effort required to learn APIs by requiring you to learn multiple ad hoc collection APIs.
  5. Reduces the effort required to design and implement APIs by not requiring you to produce ad hoc collections APIs.
  6. Fosters software reuse by providing a standard interface for collections and algorithms with which to manipulate them.

Hierarchy of Collection Framework

Collection Interfaces

The collection interfaces are divided into two groups. The most basic interface, java.util.Collection, has the following descendants:

  • java.util.Collection
  • java.util.List
  • java.util.Set
  • java.util.SortedSet
  • java.util.NavigableSet
  • java.util.Queue
  • java.util.concurrent.BlockingQueue
  • java.util.concurrent.TransferQueue
  • java.util.Deque
  • java.util.concurrent.BlockingDeque 

Interfaces

List Implementations

General-Purpose List Implementations:

Special-Purpose List Implementations:

Set Implementations

General-Purpose Set Implementations:

Special-Purpose Set Implementations:

Map Implementations

General-purpose Map Implementations:

Leave a comment

Your email address will not be published. Required fields are marked *