Chapter10 Collections.

Slides:



Advertisements
Similar presentations
Transparency No. 1 Java Collection API : Built-in Data Structures for Java.
Advertisements

JAVA Programming (Session 7) When you are willing to make sacrifices for a great cause, you will never be alone. Instructor:
首 页 首 页 上一页 下一页 本讲内容 投影法概述三视图形成及其投影规律平面立体三视图、尺寸标注 本讲内容 复习: P25~P31 、 P84~P85 作业: P7, P8, P14[2-32(2) A3 (1:1)]
Lecture 3 Introduction to Collections Advanced Java Programming 1 dr inż. Wojciech Bieniecki
Collections Framework A very brief look at Java’s Collection Framework David Davenport May 2010.
数控机床结构及维修 主编:于万成 王桂莲 副主编:李昊 人民邮电出版社 北京 ◎ 了解数控系统的组成和常见数控系统 的特点 ◎ 熟悉常见数控系统的参数设置 ◎ 掌握数控系统的常见故障诊断及维修 方法 调试与维修数控 机床的数控系统.
Java Collections Framework COMP53 Oct 24, Collections Framework A unified architecture for representing and manipulating collections Allows collections.
嵌入式操作系统 陈香兰 Fall 系统调用 10/27/09 嵌入式 OS 3/12 系统调用的意义  操作系统为用户态进程与硬件设备进行交互提供 了一组接口 —— 系统调用  把用户从底层的硬件编程中解放出来  极大的提高了系统的安全性  使用户程序具有可移植性.
1 L43 Collections (3). 2 OBJECTIVES  To use the collections framework interfaces to program with collections polymorphically.  To use iterators to “walk.
Sets and Maps Chapter 9. Chapter 9: Sets and Maps2 Chapter Objectives To understand the Java Map and Set interfaces and how to use them To learn about.
What Is a Collection?  A collection (sometimes called a container) is simply an object that groups multiple elements into a single unit.  Collections.
24-Jun-15 Introduction to Collections. 2 Collections A collection is a structured group of objects Java 1.2 introduced the Collections Framework Collections.
实验三: 用双线性变换法设计 IIR 数字滤波器 一、实验目的 1 熟悉用双线性变换法设计 IIR 数字滤波器的原理与方法。 2 掌握数字滤波器的计算机仿真方法。 3 通过观察对实际心电图信号的滤波作用, 获得数字滤波的感性知 识。
Data Structures & Java Collections Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L15 (Chapter 22) Java Collections.
信息利用与学术论文写作 Library of Jiangsu University, Zhenjiang Sha Zhenjiang
The Java Collections Package C. DeJong Fall 2001.
Chapter 19 Java Data Structures
Java's Collection Framework
SEG4110 – Advanced Software Design and Reengineering TOPIC G Java Collections Framework.
Java Collections Framework A presentation by Eric Fabricant.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 22 Java Collections.
Collections F The limitations of arrays F Java Collection Framework hierarchy  Use the Iterator interface to traverse a collection  Set interface, HashSet,
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 22 Java Collections.
Java™ How to Program, 9/e Presented by: Dr. José M. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
1 Java's Collection Framework By Rick Mercer with help from The Java Tutorial, The Collections Trail, by Joshua BlockThe Collections Trail.
111 © 2002, Cisco Systems, Inc. All rights reserved.
COLLECTIONS Byju Veedu s/Collection.html.
Chapter 18 Java Collections Framework
Computer Science 209 Software Development Java Collections.
Data structures and algorithms in the collection framework 1.
Java.util.Vector Brian Toone 10/3/07 Updated 10/10/07.
Chapter 12: Collections by Lewis and Loftus (Updated by Dan Fleck) Coming up: Collections.
1 Interfaces in Java’s Collection Framework Rick Mercer.
Collections Data structures in Java. OBJECTIVE “ WHEN TO USE WHICH DATA STRUCTURE ” D e b u g.
OpenGIS ® Simple Features Implementation Specification for OLE/COM.
13 Collections Framework. 2 Contents What is Collection? Collections Framework Collections Hierarchy Collections Implementations Set List Map.
CS Ananda Gunawardena.  A collection (sometimes called a container) is simply an object that groups multiple elements into a single unit.  Collections.
参考文献管理软件. 常见参考文献管理软件 : 中文 : CNKI E-learning (目前免费) NoteExpress NoteFirst 英文: Refworks Endnote (网络版免费) Mendeley……
1 Process Description and Control Chapter 3. 2 Requirements of an Operating System Interleave the execution of multiple processes to maximize processor.
Nov 22, 2010IAT 2651 Java Collections. Nov 22, 2010IAT 2652 Data Structures  With a collection of data, we often want to do many things –Organize –Iterate.
1 Java's Collection Framework Map and Sets. 2 Collection Framework  A collections framework is a unified architecture for representing and manipulating.
1 Copyright © 2011 Tata Consultancy Services Limited COLLECTIONS By TEAM 5 Rajendhiran Sivan Christi Yashwanth Bijay Smruthi Satyajit.
University of Limerick1 Collections The Collection Framework.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 21 Sets and Maps.
党员发展流程 —— 惠东县住建局. 发展流程示例 制定发展 党员规划 递交入党 申请书 确定发展 对象 确定入党 积极分子 预审 入党积极 分子培养 教育考察 入党材料 归档 预备党员 转正 预备党员 教育考察 预备党员 接收审批.
Sets and Maps Chapter 9. Chapter Objectives  To understand the Java Map and Set interfaces and how to use them  To learn about hash coding and its use.
Collections Dwight Deugo Nesa Matic
Java Collection Classes Com379PT
3-1 Java's Collection Framework Another use of polymorphism and interfaces Rick Mercer.
Lecture 9:FXML and Useful Java Collections Michael Hsu CSULA.
你知道多细胞动物 和人的生长发育是 从什么细胞开始的 吗 ? 受精卵 分化 肌肉细胞 上皮细胞 人体的各种细胞图.
©Karsten Lundqvist Example: Array and Arrays 1 import java.util.*; public class Example { private int intValues[] = { 1, 2, 3, 4, 5, 6 }; private double.
Chapter 21 Sets and Maps Jung Soo (Sue) Lim Cal State LA.
Sets and Maps Chapter 9.
Module 7.
Chapter 19 Java Data Structures
Software Development Java Collections
Programming & Data Structures
University of Central Florida COP 3330 Object Oriented Programming
Java Collections Overview
Collections in Java The objectives of this lecture are:
Object-Oriented Programming Paradigm
Collections Not in our text.
Collections Framework
Programming Languages
CSE 1020: The Collection Framework
Sets and Maps Chapter 9.
1.4 ทบทวน JAVA OO Programming Concepts Declaring and Creating Objects
Presentation transcript:

Chapter10 Collections

What Is a Collection? ▲ a poker hand (a collection of cards), ● A collection is simply an object that groups multiple elements into a single unit. ● sometimes called a container ● Collections are used to store, retrieve and manipulate data, and to transmit data from one method to another. ● Collections typically represent data items that form a natural group, like ▲ a poker hand (a collection of cards), ▲ a mail folder (a collection of letters), ▲ a telephone directory (a collection of name-to-phone-number mappings). retrieve   retrieve[简明英汉词典] [riˈtri:v] vt. 1 寻回, 找回 2 恢复, 挽回 3 检索(储存的信息) 4 使某事物恢复旺盛状态  vt. & vi. (指经过训练的狗)找到并衔回(被打死或打伤的鸟等) poker   poker[简明英汉词典] [ˈpəukə] n. 1 拨火铁棒 2 纸牌; 扑克 

Collections Framework ● A collections framework is a unified architecture for representing and manipulating collections.

All collections frameworks contain three things Interfaces Implementations Algorithms

Interfaces: abstract data types representing collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages like Java, these interfaces generally form a hierarchy. general form   general form[简明英汉词典] (普)通式 词条指正 - Google 搜索

Implementations: concrete implementations of the collection interfaces. In essence, these are reusable data structures. In essence   in essence[简明英汉词典] 本质上;大体上;其实 词条指正 - Google 搜索 concrete   concrete[简明英汉词典] [ˈkɔnkri:t] adj. 1 实体的, 有形的 2 确实的, 明确的, 确定的  词条指正 - Google 搜索

Algorithms: methods that perform useful computations, like searching and sorting, on objects that implement collection interfaces. These algorithms are said to be polymorphic because the same method can be used on many different implementations of the appropriate collections interface. In essence, algorithms are reusable functionality. polymorphic   polymorphic[简明英汉词典] [ˌpɔliˈmɔ:fik] adj. 多形的,多态的,多形态的 词条指正 - Google 搜索

the Benefits of a Collections Framework ● It reduces programming effort: ● It increases program speed and quality: ● It allows interoperability among unrelated APIs: ● It reduces the effort to learn and use new APIs: ● It reduces effort to design new APIs: ● It fosters software reuse: By providing useful data structures and algorithms foster   foster[简明英汉词典] [ˈfɔstə] vt. 培养, 促进 vt. & vi. 收养, 养育 词条指正 - Google 搜索

The core collection interfaces ● The core collection interfaces are the interfaces used to manipulate collections, and to pass them from one method to another. ● The basic purpose of these interfaces is to allow collections to be manipulated independently of the details of their representation. ● The core collection interfaces are the heart and soul of the collections framework.

The core collections interfaces are shown below:

AbstractSequentialList Collections Framework Collection List Set Map SortedSet SortedMap ArrayList LinkedList HashSet TreeSet HashMap TreeMap AbstractList AbstractSet AbstractMap AbstractSequentialList AbstractCollection

Collection The Collection interface is the root of the collection hierarchy. A Collection represents a group of objects, known as its elements. Some Collection implementations allow duplicate elements and others do not. Set A Set is a collection that cannot contain duplicate elements. List A List is an ordered collection (sometimes called a sequence). Lists can contain duplicate elements. Map A Map is an object that maps keys to values. Maps cannot contain duplicate keys: Each key can map to at most one value.

*参见程序运行