You shouldn't need to alter getSortedElements() at all.
It can be used outside the context of paging..

But what I'm saying is that you will need an implementation of IGetElementsForPaging that calls it, replicating the existing functionality.