CS2110: SW Development Methods. Textbook readings: MSD, Chapter 8 (Sect. 8.1 and 8.2) But we won ’ t implement our own, so study the section on Java ’ s Map classes… MSD, Chapter 9 (Sect. 9.3.2 and 9.3.4). Sets and Maps in Java. Set and HashSet in Java Collections.
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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Sets and Maps in Java
int numUniq = new HashSet(aCollection).size();
Set noDups = new HashSet( aCollection );aCollection.clear();aCollection.addAll( noDups );
return artist.hashCode() + title.hashCode();
Double dval = new Double(doubleKeyField);
Map<String,Integer> // maps string to a number
Map<Student,String> // maps Student to a StringMap<String,List<Course>> // e.g. a schedule