Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to selectively get values from Map  RSS feed

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am having lots of trouble figuring out how to get specific values from a Map. I understand that a Map returns objects.

The elements in the map will always stay the same, however, the order can be different.

How can I do something like this:

Object value2 = facetQuery.get("prc:[50 TO 74.99]");

Here is my code:

Here is the output:

Thank you!


Oh, this worked:
Integer value2 = facetQuery.get("prc:[50 TO 74.99]") ;
out.println("this(" + value2 + ")");
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!