1 / 8

Some here are primitive data types

Some here are primitive data types. Characterize data into different kinds for convenience. bit byte integer ascii character array string real record. objects. + operations. Abstraction primitive date types are already abstracted from bits 0/1.

amos-martin
Download Presentation

Some here are primitive data types

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Some here are primitive data types • Characterize data into different kinds for convenience • bit • byte • integer • ascii • character • array • string • real • record objects + operations IT 179

  2. Abstraction primitive date types are already abstracted from bits 0/1 • A tool (concept) to manage complexity • Hide irrelevant details; focus on the features needed • Examples • Integer addition • File deletion using icons • The brakes on a car • Television remotes IT 179

  3. Data Type (how to view it) • Specification View of a data type • Data values • Operations defined on those values • Abstract Data Type (ADT) –use of abstraction! • Implementation View of a data type • Language-specific representation for the values • Implementation of the operations  Implementation of an ADT IT 179

  4. Abstract Data Type (ADT) Abstract model of Priority Queues (Specification View) insert one item Priority Queue Get the one with the highest priority the minimum one (or maximum) a black box IT 179

  5. Abstract Data Type (ADT) Abstract model of Priority Queues (Implementation View) insert one item Binary Search Tree or Binary Heap? Get the one with the highest priority the minimum one (or maximum) IT 179

  6. What do we want/need to do on arrays? int[] A; double[] B; IT 179

  7. Add an element Remove an element Replace an element Retrieve an element Determine if a collection contains an element Get the collection’s size Determine if a collection is empty Traverse a collection Determine if two collections are equal Clone a collection Serialize a collection Typical Collection Operations Most collections support the same operations, but may give them different names. IT 179

  8. Collection Queue List {interface} {interface} {interface} RandomAccess AbstractList {interface} {abstract} The Java Collections Framework (JCF) UML Class Diagram ArrayList Vector AbstractSequentialList {abstract} Java Provides a List interface for several implementations Stack LinkedList IT 179

More Related