The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Printing matching Map??

Posted by Joseph on October 03, 2001 at 8:58 PM

Hi all,

I have created an array of HashMaps with the following values:
HashMap map[0] = new HashMap;
map[0].put("SSN", "999999999");
map[0].put("FNAME", "XYZ");
map[0].put("LNAME", "ABC");
map[0].put("ADDRESS", "123");

HashMap map[1] = new HashMap;
map[1].put("SSN", "1234567890");
map[1].put("FNAME", "DEF");
map[1].put("LNAME", "GHI");
map[0].put("ADDRESS", "456");

and so on..

I am trying to test my code so that when the user searches by SSN or LNAME or by both, it searches through all the maps
and returns the matching map. However, I am having trouble getting the map to be printed. How do I do it?

Here is a part of my test code:

input.put("SSN","1234567890");
Map retMap = (Map) result.getResponse();
printMap(retMap);

input.put("LNAME","");
retMap = (Map) result.getResponse();
printMap(retMap);

input.put("SSN","");
input.put("LNAME","");
retMap = (Map) result.getResponse();
printMap(retMap);

//private void printMap(Map map)
//{
//}




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us