By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

J2ME: RecordEnumeration Ordering?

P: n/a
How do you reverse the order in an J2ME RecordEnumeration? I get a
result of 3, 2, 1 instead of 1, 2, 3 for the code below.

RecordEnumeration enum = recordStore.enumerateRecords(null, null,
false); while( enum.hasNextElement() )
{
byte[] data = enum.nextRecord();
String recordStr = readRecord( data );
System.out.println(recordStr);
}

What's the deal here?
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"gilgantic" <gi*******@yahoo.com> wrote in message
news:d6**************************@posting.google.c om...
How do you reverse the order in an J2ME RecordEnumeration? I get a
result of 3, 2, 1 instead of 1, 2, 3 for the code below.

RecordEnumeration enum = recordStore.enumerateRecords(null, null,
false); while( enum.hasNextElement() )
{
byte[] data = enum.nextRecord();
String recordStr = readRecord( data );
System.out.println(recordStr);
}

What's the deal here?


The order in which the records are returned is never guaranteed (better:
they are not ordered).
If you want to order the record-enumeration, use the
javax.microedition.rms.RecordComparator interface.

-- Anton.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.