JavaCollections-abbrev.ppt

This preview shows page 1 - 7 out of 21 pages.

Transparency No. 1 Java Collection API : Built-in Data Structures for Java based on original presentation by C.-C. Chen
Image of page 1

Subscribe to view the full document.

Java Collection Transparency No. 2 The Java Collection API Interfaces: Collection Set SortedSet, List Map SortedMap Iterator ListIterator Comparator
Image of page 2
Java Collection Transparency No. 3 Summary of all interfaces in the java Collection API Collection Interfaces : The primary means by which collections are manipulated. Collection Set, List A group of objects. May or may not be ordered; May or may not contain du plicates. Set SortedSet The familiar set abstraction. No duplicates; May or may not be ordered. SortedSet elements automatically sorted, either in their natural ordering (see the Comparable interface), or by a Compa rator object provided when a SortedSet instance is cr eated. List Ordered collection, also known as a sequence . Duplicates permitted; Allows positional access.
Image of page 3

Subscribe to view the full document.

Java Collection Transparency No. 4 Map SortedMap A mapping from keys to values. Each key can map to at most one value (function). SortedMap A map whose mappings are automatically sorted by ke y, either in the keys' natural ordering or by a com parator provided when a SortedMap instance is creat ed.
Image of page 4
Java Collection Transparency No. 5 classes of the java collection API 1. AbstractCollection ( Collection ) AbstractSet ( Set ) HashSet , TreeSet ( SortedSet ) AbstractList ( List ) ArrayList , AbstractSequentia lList LinkedList AbstractMap (Map) HashMap TreeMap (SortedMap) WeakHashMap Arrays Collections
Image of page 5

Subscribe to view the full document.

Java Collection Transparency No. 6 General-Purpose Implementation classes The primary implementations of the collection interfaces. HashSet : Hash table implementation of the Set interface. TreeSet : Red-black tree implementation of the SortedSet interfa ce. ArrayList : Resizable-array implementation of the List interfac e. (Essentially an unsynchronized Vector.) The best all-around implementati on of the List interface. LinkedList : Doubly-linked list implementation of the List inter face. May provide better performance than the ArrayList implementation if element s are frequently inserted or deleted within the list. Useful for queues and double-ended queues (deques). HashMap : Hash table implementation of the Map interface. (Essentially an unsynchronized Hashtable that supports null keys and value s.) The best all-around implementation of the Map interface.
Image of page 6
Image of page 7
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern