CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #2
    Join Date
    Jan 2012
    Posts
    4

    Re: trouble with method algorythm

    Problem solved. Had to rewrite method getArrayFieldValues(....):

    Code:
    private ArrayList<LinkedHashMap<String,Object>> getArrayFieldValues(String id, String[][] data)
      {
    	  
    	  ArrayList<LinkedHashMap<String,Object>> list = new ArrayList<LinkedHashMap<String,Object>>();
    	  int index = 0;
    	  LinkedHashMap<String,Object> temp = null; 
    	  for(int i = 0; i < data.length; i++)
    	  {
    		  if(id.equals(data[i][0]))
    		  {	
                                                temp = new LinkedHashMap<String,Object>();		  
                  		  
    			  for(int j = 1; j < data[0].length; j++)
    			  {
    			    temp.put(fields[index].getName(),data[i][j]);
    			    index++;			    
    			  }
    			  index = 0;//reset
    			  list.add(temp);
    		  }
    	  }
    	  	  
    	  return list;
      }
    Last edited by ashiers; June 5th, 2013 at 04:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured