Solved

Map  Collection Views

Posted on 2011-09-07
3
214 Views
Last Modified: 2012-05-12
I would like to know about Map  Collection Views . what are different types of it. when, how, where, why we use them. i am not clear on this concept. thanks in advance
0
Comment
Question by:gudii9
  • 2
3 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36495784

This is from doc API:
http://download.oracle.com/javase/1.4.2/docs/api/java/util/Map.html

The Map interface provides three collection views, which allow a map's contents to be viewed as a set of keys, collection of values, or set of key-value mappings. The order of a map is defined as the order in which the iterators on the map's collection views return their elements. Some map implementations, like the TreeMap class, make specific guarantees as to their order; others, like the HashMap class, do not.
0
 
LVL 7

Author Comment

by:gudii9
ID: 36639500
>>The Map interface provides three collection views

what is collection view. please elaborate on this. does any other collection objects like set, list etc has collection views?
0
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 36643779
They just explain that when considering the Map interface we
can think of te set of keys, collection of vlaues or babout set of Key-Value entries
It just comes form the nature of what is a Map as entity which maps one object to another and has a set of such pairs.
Once there is a set of these pairs - you may think about the set of keys, you may think about collection of values (values may be duplicates, so they are not set,
as we name by Set -a collection which does not have duplicates).

If you think about say ArrayList - you'll not have idea about such other collections whiach are so naturally related
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 64
designing in object programming 12 94
login form jsp example 2 35
Java: anonymous class 4 29
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question