1
17-214
Principles of Software Construction: Objects, Design, and - - PowerPoint PPT Presentation
Principles of Software Construction: Objects, Design, and Concurrency API Design 1: process and naming Josh Bloch Charlie Garrod 17-214 1 Administrivia Homework 4b due Today (11:59 PM) 17-214 2 Review: libraries, frameworks both define
1
17-214
2
17-214
3
17-214
public MyWidget extends JContainer { ublic MyWidget(int param) {/ setup internals, without rendering } / render component on first view and resizing protected void paintComponent(Graphics g) { // draw a red box on his componentDimension d = getSize(); g.setColor(Color.red); g.drawRect(0, 0, d.getWidth(), d.getHeight()); } } public MyWidget extends JContainer { ublic MyWidget(int param) {/ setup internals, without rendering } / render component on first view and resizing protected void paintComponent(Graphics g) { // draw a red box on his componentDimension d = getSize(); g.setColor(Color.red); g.drawRect(0, 0, d.getWidth(), d.getHeight()); } }
your code your code
4
17-214
5
17-214
6
17-214
7
17-214
8
17-214
9
17-214
10
17-214
11
17-214
12
17-214
13
17-214
14
17-214
15
17-214
16
17-214
17
17-214
// A collection of elements (root of the collection hierarchy) public interface Collection<E> { // Ensures that collection contains o boolean add(E o); // Removes an instance of o from collection, if present boolean remove(Object o); // Returns true iff collection contains o boolean contains(Object o) ; // Returns number of elements in collection int size() ; // Returns true if collection is empty boolean isEmpty(); ... // Remainder omitted }
18
17-214
19
17-214
20
17-214
21
17-214
22
17-214
23
17-214
24
17-214
25
17-214
26
17-214
27
17-214
28
17-214
30
17-214
31
17-214
32
17-214
33
17-214
34
17-214
35
17-214
36
17-214
37
17-214
38
17-214
39
17-214
41
17-214
42
17-214
43
17-214
44
17-214
45
17-214
46
17-214
47
17-214
48
17-214
49
17-214
50
17-214