The Collections Framework
Home ] Up ] What is Inheritance? ] Inheritance versus Containment ] Superclasses & Subclasses ] Visibility Modifiers & Inheritance ] Final Classes & Methods ] Polymorphism ] Data Hiding & Encapsulation ] Abstract Classes ] Interfaces ] Cloning Objects ] [ The Collections Framework ] Interfaces & Callbacks ]

 

What is It?
Vector & Enumeration
Collections Interfaces
Algorithms
Sets
Maps

 

So, we've learned about abstract classes and interfaces, right?

In reality, we'll need some examples and some practice to see how they are typically used, before we can be comfortable using them in our own code.

There are many good examples of the use of abstract classes and interfaces in the Java class libraries.  One particularly useful example is how they are used to implement the Java Collections Framework.

A collection is a "container" for a group of elements or items.  It provides operations to allow manipulation of those elements.

The Java Collections Framework is represented by the following set of classes and interfaces (the tree structure represents the inheritance hierarchy):

Package java.util:
Interfaces:
Collection
    List
    Set
        SortedSet
Comparable (in package java.lang)
Comparator
Enumeration
Iterator
    ListIterator
Map
    SortedMap
Classes:
Object
    AbstractCollection (implements Collection)
        AbstractList (implements List)
            AbstractSequentialList
                LinkedList
            ArrayList
            Vector
                Stack
        AbstractSet (implements Set)
            HashSet
            TreeSet (implements SortedSet)
    AbstractMap (implements Map)
        HashMap
        TreeMap (implements SortedMap)
        WeakHashMap
    Dictionary
        Hashtable (implements Map)
            Properties
There's clearly lots to talk about!

 

This page was last modified on 02 October, 2007