org.bson
Class KeyCachingLazyBSONObject

java.lang.Object
  extended by org.bson.LazyBSONObject
      extended by org.bson.KeyCachingLazyBSONObject
All Implemented Interfaces:
BSONObject

public class KeyCachingLazyBSONObject
extends LazyBSONObject

Author:
brendan, scotthernandez

Nested Class Summary
 
Nested classes/interfaces inherited from class org.bson.LazyBSONObject
LazyBSONObject.LazyBSONIterator, LazyBSONObject.LazyBSONKeySet
 
Field Summary
 
Fields inherited from class org.bson.LazyBSONObject
_callback, _doc_start_offset, _input
 
Constructor Summary
KeyCachingLazyBSONObject(BSONByteBuffer buffer, int offset, LazyBSONCallback callback)
           
KeyCachingLazyBSONObject(BSONByteBuffer buffer, LazyBSONCallback callback)
           
KeyCachingLazyBSONObject(byte[] data, int offset, LazyBSONCallback cbk)
           
KeyCachingLazyBSONObject(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.
 
Methods inherited from class org.bson.LazyBSONObject
containsKey, getBSONSize, getElementBSONSize, getElementType, getElementValue, isElementEmpty, isEmpty, keySet, put, putAll, putAll, removeField, sizeCString, toMap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyCachingLazyBSONObject

public KeyCachingLazyBSONObject(byte[] data,
                                LazyBSONCallback cbk)

KeyCachingLazyBSONObject

public KeyCachingLazyBSONObject(byte[] data,
                                int offset,
                                LazyBSONCallback cbk)

KeyCachingLazyBSONObject

public KeyCachingLazyBSONObject(BSONByteBuffer buffer,
                                LazyBSONCallback callback)

KeyCachingLazyBSONObject

public KeyCachingLazyBSONObject(BSONByteBuffer buffer,
                                int offset,
                                LazyBSONCallback callback)
Method Detail

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

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