Hi all,
I am trying to sort a definition objects array using the sort method, as below.
oObjDefs = ArisData.sort(oObjDefs, Constants.SORT_TYPE, Constants.AT_NAME, Constants.SORT_NONE, g_nLoc);
The required sort is by Type, Name, Symbol Num. For Type and Name its working ok. I kindly need to know what constant I need to use for the Symbol Number attribute (is there any?).
Regards,
Nicola
Robert Goldenbaum on
Hi,
you cannot sort object definitions by symbols, because the symbols are part of the properties of the occurrences. So an object definition may have multiple occurrences with different symbols.
You could use the default symbol, but this must not always be the same as the symbol the object occurrences (even if only a single one) have - so I would not use this. And there is afaik no sort method for the default symbol.
If you want to sort it, I would go through the list and add the objects to different arrays per default symbol (if you know beforehand which symbols there will be) OR I would use a java map with the key the default symbol type and the value an array of found objects...
BR Robert