This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Get keys on the basis of values in any Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Get keys on the basis of values in any Collection" Watch "Get keys on the basis of values in any Collection" New topic
Author

Get keys on the basis of values in any Collection

SaurabhSri Sri
Ranch Hand

Joined: May 01, 2008
Posts: 43
Hi,

Is there any way to get keys on the basis of values in any Collection. Actually my collection looks like this -

Service1 Start
Service2 Stop
Service3 Start
Service4 Start
Service5 Stop

Now I want to get all keys whose values are 'Stop' in a sorted manner. Please give any idea or if any other way ..

Thanks in advance.


Regards
SaurabhSri (SCJP 1.5)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41054
    
  43
Please do not post the same question to multiple forums: CarefullyChooseOneForum. This forum is -as its name implies- for questions about HTML and JavaScript.

Let's continue the discussion in this duplicate thread.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Get keys on the basis of values in any Collection
 
Similar Threads
Get keys on the basis of values in any Collection
collctions
Rise Against Corruption Anna Hazzare
Sorting values in HashMap
How to iterate over HashMap?