How to get first or last item from cqengine IndexedCollection with NavigableIndex

33 views
Skip to first unread message

Pavel Niedoba

unread,
Jul 13, 2018, 3:12:00 AM7/13/18
to cqengine-discuss

I have com.googlecode.cqengine.IndexedCollection object with NavigableIndex configured. I need to get first or last item from the index or iterator of the index in general.


I suppose this should be trivial. I know I can create Query object with queryOptions object, use it to retrieve iterator from IndexedCollection and get first object, but I'm not sure if it's optimal for performance. Surely it's not elegant.


https://stackoverflow.com/questions/51308612/how-to-get-first-or-last-item-from-cqengine-indexedcollection-with-navigableinde

Niall

unread,
Dec 5, 2018, 6:02:19 PM12/5/18
to cqengine-discuss
Sorry for the delay. I see you found a solution. Another alternative is in https://github.com/npgall/cqengine/issues/178 , but whichever works for you is fine
Reply all
Reply to author
Forward
0 new messages