[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[On Teaching and Learning]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[SamR]
[Java 1.5 API]
[Espresso]
[TAO of Java]
[CS152 2004F]
Back to An Initial Problem: Laying Out Text. On to Text Composition Lab.
Held: Tuesday, March 1, 2005
Summary: Today we learn how Java's interfaces allow us to separate the general capabilities of our classes from the particular implementations we choose.
Related Pages:
Notes:
Overview:
"*"
)
surround, given a chunk of text, we build something that contains the chunk and the lines that surround it.
SurroundedText
SurroundedText
might provide much the same operations as SimpleTextChunk
SurroundedText
and SimpleTextChunk
have the same operations, we should be able to use them in similar situations.
interface
rather than class
public interface NameOfInterface { } // interface NameOfInterface
implementsthe interface, and we add a note to the class head.
putlic class ImplementingClass implements NameOfInterface { } // class ImplementingClass
TextChunk
interface, update both SimpleTextChunk
and SurroundedText
to use it, and see what happens.
Back to An Initial Problem: Laying Out Text. On to Text Composition Lab.
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[On Teaching and Learning]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[SamR]
[Java 1.5 API]
[Espresso]
[TAO of Java]
[CS152 2004F]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Wed May 11 10:55:57 2005.
The source to the document was last modified on Mon Jan 24 10:17:07 2005.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS152/2005S/Outlines/outline.22.html
.
You may wish to
validate this document's HTML
;
;
Check with Bobby