/** * Creates a copy of an existing database cursor. The new cursor is an iterator, even if the * original was an array. * * @return the new cursor */ public DBCursor copy() { DBCursor c = new DBCursor(_collection, _query, _keysWanted, _readPref); c._orderBy = _orderBy; c._hint = _hint; c._hintDBObj = _hintDBObj; c._limit = _limit; c._skip = _skip; c._options = _options; c._batchSize = _batchSize; c._snapshot = _snapshot; c._explain = _explain; if (_specialFields != null) c._specialFields = new BasicDBObject(_specialFields.toMap()); return c; }