Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » sorting options with resource save api(Sorting options while saving a resource)
sorting options with resource save api [message #1785712] Wed, 18 April 2018 16:59 Go to next message
Manu Mohan is currently offline Manu MohanFriend
Messages: 2
Registered: August 2017
Junior Member
Our resource entities are getting sorted using Ascii values which produces an ordering that is inconsistent with human logic while doing an resource save.
using resource.save().

For eg: text1, text2, text 10 gets sorted as text1, text10 , text 2

We expect it to be sorted as text1, text2, text10.

Is there any way to get the entries sorted while we do a resource save,

or is there any other way to approach it ?
Re: sorting options with resource save api [message #1785715 is a reply to message #1785712] Wed, 18 April 2018 17:20 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6040
Registered: July 2009
Senior Member
Hi

This is a very common problem. https://www.eclipse.org/modeling/tmf/downloads/ shows Xtext 2.9.2 rather than 2.13.0 as the latest release.

I am not aware of EMF sorting things at all, so I suspect it may be your broken sorting algorithm.

If you want correctly sorted hybrid alphanumerics you need a hybrid alphanumeric comparator. Else number them as text001, text009, text010 etc.

Regards

Ed Willink
Previous Topic:How do I specify EMF genmodel compliance level in an Ant Java task
Next Topic:[CDO] Problem with reconnecting CDO Session
Goto Forum:
  


Current Time: Fri Sep 21 17:18:27 GMT 2018

Powered by FUDForum. Page generated in 0.02406 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top