Data Types and Abstraction - PowerPoint PPT Presentation

About This Presentation
Title:

Data Types and Abstraction

Description:

Name. Address. Value. Lifetime. Scope. Type. Size. Variable Represents: - A set of values ... Int, Char, Double, and String class definitions. Containers ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 30
Provided by: scie218
Category:

less

Transcript and Presenter's Notes

Title: Data Types and Abstraction


1
Data Types and Abstraction
  • Chapter 5

2
Abstract Data Types
  • Attributes of a Variable
  • Name
  • Address
  • Value
  • Lifetime
  • Scope
  • Type
  • Size

3
Variable Represents
  • - A set of values
  • - A set of operations

4
Class Hierarchy
5
Object class
  • - At the top of the class hierarchy
  • - All other classes are derived from Object,
    except Ownership

6
Object class Hierarchy
7
Object class Definition
8
Object operator definitions
9
Object class member function definitions
10
NullObject Singleton Class
  • - A concrete class derived from the Object
    abstract base class
  • - A class which only have one instance

11
NullObject class definition
12
NullObject class member function definition
13
WrapperltTgt class definition
14
WrapperltTgt class member function definitions
15
Int, Char, Double, and String class definitions
16
Containers
  • - An object that holds within it other objects
  • - Containers can be held in other containers

17
Container class definition
18
Container class member function definitions
19
Visitors
  • - Interacts with Container class
  • - Derived from abstract class Visitor
  • - Every visitor class has a different
    functionality

20
The Print Visitor
21
Visitor IsDone()
22
Put() for Container
23
Iterators
  • - Derived from abstract Iterator class
  • - An alternative to visitors
  • - For every concrete container class a concrete
    iterator

24
Iterator Class Definition
25
The NullIterator Class
26
NullIterator class member function definitions
27
Ownership class definition
28
Purge() of Container
29
SearchableContainer class definition
Write a Comment
User Comments (0)
About PowerShow.com