Collections II Christian Rodríguez Bustos Object Oriented Programming
Collections
Agenda
HashMap Class
TreeMap Class
Collections
HashSet Class
HashMap
Collections
HashMap Class
Hash Maps are dictionary type collections
Hash Maps give us direct access to a given object based on a unique key value
Collections
HashMap Class example
Unique key value
251032
235645
202978
354687
studentList HashMap
Collections
HashMap instantiation
Collections
HashMap instantiation
Object Key Type
Collections
HashMap instantiation
Object Key Type
Object (Value)
Collections
Put method example
Object Key Type Object (Value)
Collections
Put / Get methods examples
Object Key Type
Collections
If the key is not found, a null value will be returned
Contains Value / Contains Key methods examples
Collections
Is Empty / Size methods examples
Collections
Key Set / Values methods examples
Collections
Remove methods examples
Collections
TreeMap
Collections
TreeMap
TreeMap
• Objects are automatically retrieved from the collection in ascending key (sorted) order.
HashMap
• There is no guarantee as to the order in which items will be retrieved.
TreeMaps and HashMaps are instantiated using the same syntax
Collections
Testing HashMaps and TreeMaps
Collections
Iterating through HashMaps and TreeMaps
Collections
Test Program output
Unsorted
Sorted
Collections
HashSet
Collections
HashSet Methods I
Instantiation
Add
Contains?
HashSet Methods II
Size Remove?
HashSets have not a get method
HashSets are unsorted
We need an Iterator for getting elements
Collections
Testing HashSet
Collections
Test Program output
Unsorted outputs
Collections
References
[Barker] J. Barker, Beginning Java Objects: From Concepts To Code, Second Edition, Apress, 2005. [Oracle] The HashMap Class Available: http://download.oracle.com/javase/6/docs/api/java/util/HashMap.html, 2011 [Oracle] The HashSet Class Available: http://download.oracle.com/javase/6/docs/api/java/util/HashSet.html, 2011 [Oracle] The TreeMap Class Available: http://download.oracle.com/javase/6/docs/api/java/util/TreeMap.html, 2011
Hash Maps give us direct access to a given object based on a unique key value. HashMap Class. Collections. Page 5. HashMap Class example. Collections. 251032 235645 202978 354687. Unique key value. studentList HashMap. Page 6. HashMap instantiation. Collections. Page 7. HashMap instantiation. Collections.
17+ species new to that basin list. ... Biota list expanded;. ⢠Herbarium collection ... including GBIF, Calflora, BISON, California Consortium of Herbaria (CCH),.
$360. 1419. UNITED NATIONS, New York and Geneva, Issues to 1975, most all mint, Never hinged. housed in Scott. 1½ inch Specialty 2-post binder. Collection ...
G. Edward Griffin - The CreaturefromJekyllIsland pdf.01817974517 - Download Bestselling ... Trans siberian. orchestra â letters fromthelabyrinth 2015.
media such as weblogs, more formal publication streams such as ... topic of interest, may be observed in almost all varieties of texts and ..... 39% â do not list a category. Among the ..... Weblogs and Social Media (ICWSM 2009), San Jose, CA,.
media such as weblogs, more formal publication streams such as ..... tag, which is defined on their web site as âThe raw number of inbound links ... Top 10 terms in sub-topic distributions for .... Social aspects of the blogosphere have also been.
written answers to my primary questions in English, along with a fax of a completed .... act against their best interests when speaking to an American student ..... the developing world in meeting the needs of their poorest citizens. ...... and the u
... University and. Ticketmaster Online-CitySearch, Inc. April 7, 1999 ... classes that defy (large-scale) reuse ... Absolute details of the classes and interfaces.
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Box Tops and ...