com.mongodb
Class LazyWriteableDBObject

java.lang.Object
  extended by org.bson.LazyBSONObject
      extended by com.mongodb.LazyDBObject
          extended by com.mongodb.LazyWriteableDBObject
All Implemented Interfaces:
DBObject, BSONObject

public class LazyWriteableDBObject
extends LazyDBObject


Nested Class Summary
 
Nested classes/interfaces inherited from class org.bson.LazyBSONObject
LazyBSONObject.LazyBSONKeySet
 
Field Summary
 
Fields inherited from class org.bson.LazyBSONObject
_callback, _doc_start_offset, _input
 
Constructor Summary
LazyWriteableDBObject(BSONByteBuffer buff, int offset, LazyBSONCallback cbk)
           
LazyWriteableDBObject(BSONByteBuffer buff, LazyBSONCallback cbk)
           
LazyWriteableDBObject(byte[] data, int offset, LazyBSONCallback cbk)
           
LazyWriteableDBObject(byte[] data, LazyBSONCallback cbk)
           
 
Method Summary
 boolean containsField(String s)
          Checks if this object contains a field with the given name.
 Object get(String key)
          Gets a field from this object by a given name.
 boolean isEmpty()
           
 Set<String> keySet()
          Returns this object's fields' names
 Object put(String key, Object v)
          Sets a name/value pair in this object.
 void putAll(BSONObject o)
          Sets all key/value pairs from an object into this object
 void putAll(Map m)
          Sets all key/value pairs from a map into this object
 Object removeField(String key)
          Removes a field with a given name from this object.
 
Methods inherited from class com.mongodb.LazyDBObject
isPartialObject, markAsPartialObject
 
Methods inherited from class org.bson.LazyBSONObject
containsKey, entrySet, equals, getBSONSize, getElementBSONSize, getElementType, getElementValue, hashCode, isElementEmpty, pipe, sizeCString, toMap, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.bson.BSONObject
containsKey, toMap
 

Constructor Detail

LazyWriteableDBObject

public LazyWriteableDBObject(BSONByteBuffer buff,
                             LazyBSONCallback cbk)

LazyWriteableDBObject

public LazyWriteableDBObject(BSONByteBuffer buff,
                             int offset,
                             LazyBSONCallback cbk)

LazyWriteableDBObject

public LazyWriteableDBObject(byte[] data,
                             LazyBSONCallback cbk)

LazyWriteableDBObject

public LazyWriteableDBObject(byte[] data,
                             int offset,
                             LazyBSONCallback cbk)
Method Detail

put

public Object put(String key,
                  Object v)
Description copied from interface: BSONObject
Sets a name/value pair in this object.

Specified by:
put in interface BSONObject
Overrides:
put in class LazyBSONObject
Parameters:
key - Name to set
v - Corresponding value
Returns:
v

putAll

public void putAll(BSONObject o)
Description copied from interface: BSONObject
Sets all key/value pairs from an object into this object

Specified by:
putAll in interface BSONObject
Overrides:
putAll in class LazyBSONObject
Parameters:
o - the object

putAll

public void putAll(Map m)
Description copied from interface: BSONObject
Sets all key/value pairs from a map into this object

Specified by:
putAll in interface BSONObject
Overrides:
putAll in class LazyBSONObject
Parameters:
m - the map

get

public Object get(String key)
Description copied from interface: BSONObject
Gets a field from this object by a given name.

Specified by:
get in interface BSONObject
Overrides:
get in class LazyBSONObject
Parameters:
key - The name of the field fetch
Returns:
The field, if found

removeField

public Object removeField(String key)
Description copied from interface: BSONObject
Removes a field with a given name from this object.

Specified by:
removeField in interface BSONObject
Overrides:
removeField in class LazyBSONObject
Parameters:
key - The name of the field to remove
Returns:
The value removed from this object

containsField

public boolean containsField(String s)
Description copied from interface: BSONObject
Checks if this object contains a field with the given name.

Specified by:
containsField in interface BSONObject
Overrides:
containsField in class LazyBSONObject
Parameters:
s - Field name for which to check
Returns:
True if the field is present

keySet

public Set<String> keySet()
Description copied from interface: BSONObject
Returns this object's fields' names

Specified by:
keySet in interface BSONObject
Overrides:
keySet in class LazyBSONObject
Returns:
the set of all keys in the document

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in class LazyBSONObject