Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Sortedset/treemap Problem
kvarnerexpress
post Dec 29 2004, 12:41 PM
Post #1


Super Member
*********

Group: Members
Posts: 407
Joined: 13-December 04
Member No.: 2,696



I am writing code for Displaying data in ascending order using a TreeMap(). And am in a fix to resolve it. The scenario is

like this i am calling java classes in my application from another application whic is fetching data for me from their

database where i can't intervene. From thisapplication I am calling a class color.java in which objects are defined as

string . And I need to get the data and display the same using my servlet in its ascending order based on its color number.

Like this

ColorNumber Location Qty Price

100 C422 100 20
150 A1100 0575 15
200 D3760 130 500

Also While making call to color.java i get data of following types

colorlocation - Varchar
colornumber - number.
colorqty - number
colorPrice. - number


The piece of java code in my file details.java is like this

Color[] Range= colorenquiry.getColordata();
SortedMap ColorMap = new TreeMap();

for (int i=0; i<Range.length(); i++){

ColorMap.put(Range[i].colornumber, Range[i].colorlocation.toString()+""+

Range[i].colorqty.toString()+""+Range[i].colorprice.toString());

}
System.out.println(ColorMap.keySet());
System.out.println(ColorMap.values());
System.out.println(ColorMap.entrySet());
----------------------------------------------------------

Now the Problem is for few querries iam getting the sorted output as above but for queries where data is like 50- 60 rows am finding sorted data in patches like its 100,150, 200, 300, 500, 350, 600 700 425, 800, 900, 1000, 1100, 1200, 1500,250....
Please advise or have any such working examples where i can refer.

Thanks & Regards,
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Did You Face Problem Opening Pdf With Firefox?(15)
  2. 60 Seconds Countdown That Shutdown The Pc(15)
  3. Problem Installing Sims 2 Nightlife(26)
  4. I Have A Girl Problem Here(27)
  5. Upload Component - Failed(6)
  6. Problem With Page Redirect(8)
  7. Remote Assistance Problem(9)
  8. Laptop Keyboard Problem(8)
  9. Skype / Xampp Port Conflict(5)
  10. Dandruff Problem(29)
  11. Sharing Files And Printer Between Windows Vista And Xp(9)
  12. Pop-up Virus / Trojan Problem(10)
  13. How Many More Times Will I Have To Post About This?(11)
  14. Domain Problem : This Is Important..(0)
  15. Browser Compatibility Problem With Firefox - Javascript + Css(3)
  1. Terminating Hosting Problem(1)
  2. Problem With My Girlfriend Family, Need Suggestions For Action(2)
  3. Firefox 3 Cookies Problem(4)
  4. Hosting Credits Problem? [resolved](9)
  5. Counter Strike Problem(2)
  6. Problem With The Trap17 Forum(4)
  7. Attachment Problem In Pmwiki(0)
  8. What Is My (power) Problem?(4)
  9. Problem With Hosting(4)
  10. Problem Concerning Credits Reduced(12)
  11. Problem With My Pc(2)
  12. Billing Problem. Plz Help(2)


 



- Lo-Fi Version Time is now: 12th October 2008 - 03:37 PM