Unformatted text preview: in the Delete operation. Finding an item means that the class to which an item belongs has a way of recognizing a match. It is not the responsibility of the list to know what a match is; it is the responsibility of ItemClass . We need to make this assumption explicit somewhere. Let’s add an assumption to the CRC card that ItemClass must provide a compareTo method and indicate what the results must be. Java has a 10–2678.0 method defined on items of class )C7>!O and other classes in the Java Library. Let’s use that definition. We also need compareTo in the Find where item belongs in the sorted list. Know Length return length Print While ( more items ) Get next item Print item Delete(item) Find the item Remove the item Decrement length...
View Full Document
- Fall '10
- Object-Oriented Programming, Subroutine, Type system, item