Skip to content

Commit

Permalink
Hide find methods that don't return DBCursors. Removed unused field.
Browse files Browse the repository at this point in the history
  • Loading branch information
scotthernandez committed May 28, 2010
1 parent bd4b85f commit b9591e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/main/com/mongodb/DBApiLayer.java
Expand Up @@ -21,10 +21,10 @@
import java.util.*;
import java.util.logging.*;

import com.mongodb.util.*;

import org.bson.*;
import org.bson.types.*;

import com.mongodb.util.*;
/** Database API
* This cannot be directly instantiated, but the functions are available
* through instances of Mongo.
Expand Down Expand Up @@ -250,7 +250,8 @@ void killCursors( List<Long> all )
_connector.say( _db , om , WriteConcern.NONE );
}

public Iterator<DBObject> find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options )
@Override
Iterator<DBObject> find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options )
throws MongoException {

if ( ref == null )
Expand Down
15 changes: 6 additions & 9 deletions src/main/com/mongodb/DBCollection.java
Expand Up @@ -18,11 +18,10 @@

package com.mongodb;

import org.bson.*;
import org.bson.types.*;

import java.util.*;

import org.bson.types.*;

/** This class provides a skeleton implementation of a database collection.
* <p>A typical invocation sequence is thus
* <blockquote><pre>
Expand All @@ -32,6 +31,7 @@
* </pre></blockquote>
* @dochub collections
*/
@SuppressWarnings("unchecked")
public abstract class DBCollection {

final static boolean DEBUG = Boolean.getBoolean( "DEBUG.DB" );
Expand Down Expand Up @@ -106,7 +106,7 @@ public void updateMulti( DBObject q , DBObject o ) throws MongoException {
* @return the objects, if found
* @dochub find
*/
public abstract Iterator<DBObject> find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options ) throws MongoException ;
abstract Iterator<DBObject> find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options ) throws MongoException ;

/** Finds an object.
* @param ref query used to search
Expand All @@ -116,7 +116,7 @@ public void updateMulti( DBObject q , DBObject o ) throws MongoException {
* @return the objects, if found
* @dochub find
*/
public Iterator<DBObject> find( DBObject ref , DBObject fields , int numToSkip , int batchSize )
Iterator<DBObject> find( DBObject ref , DBObject fields , int numToSkip , int batchSize )
throws MongoException {
return find( ref , fields , numToSkip , batchSize , 0 );
}
Expand Down Expand Up @@ -547,7 +547,7 @@ public List distinct( String key ){
* find distinct values for a key
* @param query query to apply on collection
*/
public List distinct( String key , DBObject query ){
public List distinct( String key , DBObject query ){
DBObject c = BasicDBObjectBuilder.start()
.add( "distinct" , getName() )
.add( "key" , key )
Expand Down Expand Up @@ -812,7 +812,4 @@ public DB.WriteConcern getWriteConcern(){

final private Set<String> _createIndexes = new HashSet<String>();
final private Set<String> _createIndexesAfterSave = new HashSet<String>();

private final static DBObject _upsertOptions = BasicDBObjectBuilder.start().add( "upsert" , true ).get();

}

0 comments on commit b9591e1

Please sign in to comment.