comp 213
play

COMP 213 Advanced Object-oriented Programming Lecture 12 Java - PowerPoint PPT Presentation

COMP 213 Advanced Object-oriented Programming Lecture 12 Java Collections. The Collections Framework Unified architecture for representing and manipulating collections. Enables collections to be manipulated independently of the details


  1. COMP 213 Advanced Object-oriented Programming Lecture 12 Java Collections.

  2. The Collections Framework • Unified architecture for representing and manipulating collections. • Enables collections to be manipulated independently of the details of their representation. • Based on more than a dozen collection interfaces. • Includes implementations of these interfaces and algorithms to manipulate them.

  3. Overview A collection is an object that represents a group of objects (such as the classic Vector class). Primary advantages of a collections framework: • Reduces programming effort (provides data structures & algorithms) • Increases performance (provides high-performance implementations of data structures & algorithms) • Provides interoperability between unrelated APIs (establishes a common language to pass collections back and forth) • Fosters software reuse (provides a standard interface for collections & algorithms with which to manipulate them)

  4. Overview A collection is an object that represents a group of objects (such as the classic Vector class). Primary advantages of a collections framework: • Reduces programming effort (provides data structures & algorithms) • Increases performance (provides high-performance implementations of data structures & algorithms) • Provides interoperability between unrelated APIs (establishes a common language to pass collections back and forth) • Fosters software reuse (provides a standard interface for collections & algorithms with which to manipulate them)

  5. Overview A collection is an object that represents a group of objects (such as the classic Vector class). Primary advantages of a collections framework: • Reduces programming effort (provides data structures & algorithms) • Increases performance (provides high-performance implementations of data structures & algorithms) • Provides interoperability between unrelated APIs (establishes a common language to pass collections back and forth) • Fosters software reuse (provides a standard interface for collections & algorithms with which to manipulate them)

  6. Overview A collection is an object that represents a group of objects (such as the classic Vector class). Primary advantages of a collections framework: • Reduces programming effort (provides data structures & algorithms) • Increases performance (provides high-performance implementations of data structures & algorithms) • Provides interoperability between unrelated APIs (establishes a common language to pass collections back and forth) • Fosters software reuse (provides a standard interface for collections & algorithms with which to manipulate them)

  7. Overview A collection is an object that represents a group of objects (such as the classic Vector class). Primary advantages of a collections framework: • Reduces programming effort (provides data structures & algorithms) • Increases performance (provides high-performance implementations of data structures & algorithms) • Provides interoperability between unrelated APIs (establishes a common language to pass collections back and forth) • Fosters software reuse (provides a standard interface for collections & algorithms with which to manipulate them)

  8. The collections framework consists of: • Collection interfaces. Represent different types of collections, such as sets, lists, and maps. These interfaces form the basis of the framework. • General-purpose implementations. Primary implementations of the collection interfaces. • Legacy implementations. The collection classes from earlier releases, Vector and Hashtable, were retrofitted to implement the collection interfaces. • Algorithms. Static methods that perform useful functions on collections, such as sorting a list. • Other implementations, e.g., Concurrent, Wrapper, Convenience, and Abstract implementations.

  9. The collections framework consists of: • Collection interfaces. Represent different types of collections, such as sets, lists, and maps. These interfaces form the basis of the framework. • General-purpose implementations. Primary implementations of the collection interfaces. • Legacy implementations. The collection classes from earlier releases, Vector and Hashtable, were retrofitted to implement the collection interfaces. • Algorithms. Static methods that perform useful functions on collections, such as sorting a list. • Other implementations, e.g., Concurrent, Wrapper, Convenience, and Abstract implementations.

  10. The collections framework consists of: • Collection interfaces. Represent different types of collections, such as sets, lists, and maps. These interfaces form the basis of the framework. • General-purpose implementations. Primary implementations of the collection interfaces. • Legacy implementations. The collection classes from earlier releases, Vector and Hashtable, were retrofitted to implement the collection interfaces. • Algorithms. Static methods that perform useful functions on collections, such as sorting a list. • Other implementations, e.g., Concurrent, Wrapper, Convenience, and Abstract implementations.

  11. The collections framework consists of: • Collection interfaces. Represent different types of collections, such as sets, lists, and maps. These interfaces form the basis of the framework. • General-purpose implementations. Primary implementations of the collection interfaces. • Legacy implementations. The collection classes from earlier releases, Vector and Hashtable, were retrofitted to implement the collection interfaces. • Algorithms. Static methods that perform useful functions on collections, such as sorting a list. • Other implementations, e.g., Concurrent, Wrapper, Convenience, and Abstract implementations.

  12. The collections framework consists of: • Collection interfaces. Represent different types of collections, such as sets, lists, and maps. These interfaces form the basis of the framework. • General-purpose implementations. Primary implementations of the collection interfaces. • Legacy implementations. The collection classes from earlier releases, Vector and Hashtable, were retrofitted to implement the collection interfaces. • Algorithms. Static methods that perform useful functions on collections, such as sorting a list. • Other implementations, e.g., Concurrent, Wrapper, Convenience, and Abstract implementations.

  13. Collection Interfaces Divided into two groups: • java.util.Collection (the most basic interface), and • java.util.Map (not true collections, but contain collection-view operations, which enable them to be manipulated as collections.

  14. Collection Interfaces Divided into two groups: • java.util.Collection (the most basic interface), and • java.util.Map (not true collections, but contain collection-view operations, which enable them to be manipulated as collections.

  15. java.util.Collection • Collection - A group of objects. No assumptions are made about the order of the collection (if any) or whether it can contain duplicate elements. • Set -The familiar set abstraction. No duplicate elements permitted. May or may not be ordered. • SortedSet - A set whose elements are automatically sorted, either in their natural ordering or by a comparator provided when a SortedSet instance is created. • List - Ordered collection, also known as a sequence. Duplicates are generally permitted. Allows positional access. • Queue - A collection designed for holding elements before processing. Besides basic Collection operations, queues provide additional insertion, extraction, and inspection operations. • Deque - A double ended queue, supporting element insertion and removal at both ends.

  16. java.util.Collection • Collection - A group of objects. No assumptions are made about the order of the collection (if any) or whether it can contain duplicate elements. • Set -The familiar set abstraction. No duplicate elements permitted. May or may not be ordered. • SortedSet - A set whose elements are automatically sorted, either in their natural ordering or by a comparator provided when a SortedSet instance is created. • List - Ordered collection, also known as a sequence. Duplicates are generally permitted. Allows positional access. • Queue - A collection designed for holding elements before processing. Besides basic Collection operations, queues provide additional insertion, extraction, and inspection operations. • Deque - A double ended queue, supporting element insertion and removal at both ends.

  17. java.util.Collection • Collection - A group of objects. No assumptions are made about the order of the collection (if any) or whether it can contain duplicate elements. • Set -The familiar set abstraction. No duplicate elements permitted. May or may not be ordered. • SortedSet - A set whose elements are automatically sorted, either in their natural ordering or by a comparator provided when a SortedSet instance is created. • List - Ordered collection, also known as a sequence. Duplicates are generally permitted. Allows positional access. • Queue - A collection designed for holding elements before processing. Besides basic Collection operations, queues provide additional insertion, extraction, and inspection operations. • Deque - A double ended queue, supporting element insertion and removal at both ends.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend