/**
* @return a new cursor to the location in a query sorted in the reverse direction
* @see com.google.appengine.api.datastore.Query#reverse()
*/
public Cursor reverse() {
CompiledCursor clone = compiledCursor.clone();
if (clone.hasPosition()) {
clone.getPosition().setStartInclusive(!clone.getPosition().isStartInclusive());
} else if (clone.hasPostfixPosition()) {
IndexPostfix postfixPosition = clone.getPostfixPosition();
postfixPosition.setBefore(!postfixPosition.isBefore());
} else if (clone.hasAbsolutePosition()) {
IndexPosition absolutePosition = clone.getAbsolutePosition();
absolutePosition.setBefore(!absolutePosition.isBefore());
}
return new Cursor(clone);
}