Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Collections class not showing in import util package?

hi all

 

i am using Eclipse 3.4 with blackberry jde plugin 1.0 , if i import util package ,in util package Vector,Calander,Date,HashTable etc classes comming but Collection and Collections classess not comming.

 

 

can anyone help me?

 

regards

savi

Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: Collections class not showing in import util package?

Are these classes in the API?

 

I think you might find that J2ME doesn't support a lot of these?

Please use plain text.
Developer
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: Collections class not showing in import util package?

hi peter

 

thanks you , Collections is not in j2me api.

 

then how i can sort my vector? bcoz i am storing data in vector?

 


 

 

Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: Collections class not showing in import util package?

How can you sort your Vector?  Write a sort?

 

Actually there is always SimpleSortingVector and SimpleSortingIntVector. 

Please use plain text.
Developer
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: Collections class not showing in import util package?

in vector , i can sort like this

 

Vector v = new Vector();


v.add("anupama");
v.add("jyothi");
v.add("durga");
v.add("vaseef");
v.add("priya");


Collections.sort(v);

 

But Collections class not available in j2me CLDC package.

 

i am using SimpleSortingVector but i am getting 104(null pointer exception)....

 

can you tell me ? how i can use this class ?

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: Collections class not showing in import util package?

Sorry I know nothing more that what it says in the API docs.  I do most of my sorts myself.

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Collections class not showing in import util package?

To use SimpleSortingVector, you must provide your own Comparator implementation. This class will compare two objects (passed from the vector class), returning a value which indicates their order.

 

It's all in the javadocs.

 

Please use plain text.