Java Collection Framework
[Pages:71]Java Collection Framework
Version March 2009
Framework
Interfaces (ADT, Abstract Data Types) Implementations (of ADT) Algorithms (sort)
java.util.*
Java 5 released!
Lots of changes about collections
2
Interfaces
Iterable Collection Set Queue List SortedSet Group containers
Map
SortedMap Associative containers
3
Implementations
Collection
Map
Set Queue List
Sorted Set
HashSet
Linked HashSet
TreeSet
Linked Array List List
Priority Queue
Sorted Map
HashMap TreeMap Linked
HashMap
4
Internals
data structure
Hash table
Resizable array
Balanced tree
Linked list
Hash table Linked list
Set HashSet
TreeSet
LinkedHashSet
List
ArrayList
LinkedList
Map HashMap
TreeMap
LinkedHashMap
interface
classes
5
Collection
Group of elements (references to objects) It is not specified whether they are
Ordered / not ordered Duplicated / not duplicated
Following constructors are common to all classes implementing Collection
T() T(Collection c)
6
Collection interface
int size() boolean isEmpty() boolean contains(Object element) boolean containsAll(Collection c) boolean add(Object element) boolean addAll(Collection c) boolean remove(Object element) boolean removeAll(Collection c) void clear() Object[] toArray() Iterator iterator()
7
Collection example
Collection persons = new LinkedList();
persons.add( new Person("Alice") ); System.out.println( persons.size() ); Collection copy =
new TreeSet(); copy.addAll(persons);//new TreeSet(persons) Person[] array = copy.toArray(); System.out.println( array[0] );
8
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- java s collection framework university of arizona
- collections in java aalborg universitet
- java collection framework
- java collections list set map stanford university
- lecture 4 the java collections framework york university
- the java collections framework computer science
- jjaavvaa ccoolllleeccttiioonnss
- principles of software construction objects design and
- java collections framework
- generic types and the java collections framework
Related searches
- framework for customer relationship management
- monitoring and evaluation framework pdf
- theoretical framework social work
- monitoring and evaluation framework example
- 5 component framework information systems
- people process technology framework wikipedia
- evaluation framework template
- framework for monitoring and evaluation
- framework analysis approach
- monitoring and evaluation framework template
- five component framework information systems
- social work conceptual framework theories