Saturday, September 25, 2010

Collection introduction (Index)

1. Some methods of collecting

2. What are collections?


3. Introduction to collections
In Java 1.2, an entirely new set of interfaces and classes was added to the Java libraries to support more sophisticated collections handling. Earlier there were vectors and hashtable and stack...later came Collections, lists, sets and map. Java 5 introduces queue.

4. Interface in Collections
describes the core collection interfaces, which are the heart and soul of the Java Collections Framework. You'll learn general guidelines for effective use of these interfaces, including when to use which interface. You'll also learn idioms for each interface that will help you get the most out of the interfaces.
Some interfaces in this framework:

Interface for object ordering:

5. Implementations in Collections
describes the JDK's general-purpose collection implementations and tells you when to use which implementation. You'll also learn about the wrapper implementations, which add functionality to general-purpose implementations. Some implementations in java collections:
  • Vectors implements RandomAccess //synchronized equivalent of ArrayList
  • AbstractCollection implements Collection, Iterable
  • AbstractList implements List 
  • ArrayList implements RandomAccess 
  • AbstractSequentialList 
  • LinkedList implements Deque 
  • Stack //adds peek,push and pop()
  • AbstractSet implements Set 
  • HashSet 
  • LinkedHashSet
  • TreeSet implements SortedSet
  • EnumSet // Bitset implementation for Enum class. 
  • AbstractQueue implements Queue
  • PriorityQueue
  • ArrayDeque implements Queue Deque

Besides these classes , there is Collections(note plural) or java.util.Collections which has static methods to deal with collections.

6. Algorithms describes the polymorphic algorithms provided by the JDK to operate on collections. With any luck you'll never have to write your own sort routine again!

7. Custom Implementations tells you why you might want to write your own collection implementation (instead of using one of the general-purpose implementations provided by the JDK), and how you'd go about it. It's easy with the JDK's abstract collection.

8. Interoperability tells you how the collections framework interoperates with older APIs that predate the addition of Collections to Java. Also, it tells you how to design new APIs so that they'll interoperate seamlessly with other new APIs. 

9. Class or Interface : When using collections? 

10. Performance of various collections


Examples


No comments:

Post a Comment

Chitika