Current time: 05-23-2012, 02:33 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Java-Collections-Framework Seminar
12-14-2010, 04:25 AM
Post: #1

Java-Collections-Framework Seminar
Objectives
To describe the Java Collections Framework hierarchy (§22.1).
To use the common methods defined in the Collection interface for operating sets and lists (§22.2).
To use the Iterator interface to traverse a collection (§22.3).
To use the JDK 1.5 foreach loop to simplify traversing a collection (§22.3).
To discover the Set interface, and know how and when to use HashSet, LinkedHashSet, or TreeSet to store elements (§22.3).
To compare elements using the Comparator interface (§22.4).
To explore the List interface, and know how and when to use ArrayList or LinkedList to store elements (§22.5).
To know how to use the static methods in the Collections class for lists and collections (§22.6).
To distinguish Vector and ArrayList, and know how to use Vector and Stack (§22.7).
To explore the relationships among Collection, Queue, LinkedList, and PriorityQueue and to create priority queues using the PriorityQueue class (§22.8).
To understand the differences between Collection and Map, and know how and when to use HashMap, LinkedHashMap, and TreeMap to store values associated with keys (§22.9).
To obtain singleton sets, lists, and maps, and unmodifiable sets, lists, and maps using the static methods in the Collections class (§22.10).
Java Collection Framework hierarchy
A collection is a container object that represents a group of objects, often referred to as elements. The Java Collections Framework supports three types of collections, named sets, lists, and maps.
Java Collection Framework hierarchy, cont.
Set and List are subinterfaces of Collection.
Java Collection Framework hierarchy, cont.
An instance of Map represents a group of objects, each of which is associated with a key. You can get the object from a map using a key, and you have to use a key to put the object into the map.
The Collection Interface
The Collection interface is the root interface for manipulating a collection of objects.
The Set Interface
The Set interface extends the Collection interface. It does not introduce new methods or constants, but it stipulates that an instance of Set contains no duplicate elements. The concrete classes that implement Set must ensure that no duplicate elements can be added to the set. That is no two elements e1 and e2 can be in the set such that e1.equals(e2) is true.
The Set Interface Hierarchy
The AbstractSet Class
The AbstractSet class is a convenience class that extends AbstractCollection and implements Set. The AbstractSet class provides concrete implementations for the equals method and the hashCode method. The hash code of a set is the sum of the hash code of all the elements in the set. Since the size method and iterator method are not implemented in the AbstractSet class, AbstractSet is an abstract class.
The HashSet Class
The HashSet class is a concrete class that implements Set. It can be used to store duplicate-free elements. For efficiency, objects added to a hash set need to implement the hashCode method in a manner that properly disperses the hash code.


Attached File(s)
.ppt  Java-Collections-Framework.ppt (Size: 303 KB / Downloads: 18)
Find all posts by this user
Quote this message in a reply
Post Reply 


[-]
Share/Bookmark (Show All)
Facebook Linkedin Technorati Twitter Digg MySpace Delicious

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  UTILIZACION-DEL-IDE-ECLIPSE-y-JAVA-2003 Seminar born_for seminars 0 430 12-14-2010 04:42 AM
Last Post: born_for seminars
  Slides-de-Aula-Java-Micro-Edition-J2ME Seminar born_for seminars 0 337 12-14-2010 04:41 AM
Last Post: born_for seminars
  Sending-and-receiving-xml-in-java-application Seminar born_for seminars 0 230 12-14-2010 04:40 AM
Last Post: born_for seminars
  Ruby-On-Java Seminar born_for seminars 0 374 12-14-2010 04:40 AM
Last Post: born_for seminars
  Oracle-AS-Java-Object-Cache Seminar born_for seminars 0 176 12-14-2010 04:39 AM
Last Post: born_for seminars
  OOPs Through JAVA Seminar born_for seminars 0 195 12-14-2010 04:37 AM
Last Post: born_for seminars
  Object-Oriented-Programming-09-Transform-UML-to-Java Seminar born_for seminars 0 415 12-14-2010 04:37 AM
Last Post: born_for seminars
  Object-Oriented-Programming-02-Java-Fundamentals Seminar born_for seminars 0 194 12-14-2010 04:36 AM
Last Post: born_for seminars
  Network-programming-and-java-Sockets Seminar born_for seminars 0 344 12-14-2010 04:35 AM
Last Post: born_for seminars
  Multi Threaded Programming Seminar born_for seminars 0 192 12-14-2010 04:34 AM
Last Post: born_for seminars

Forum Jump:


User(s) browsing this thread: 1 Guest(s)