|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bson.LazyBSONObject
public class LazyBSONObject
Nested Class Summary | |
---|---|
class |
LazyBSONObject.LazyBSONKeySet
|
Field Summary | |
---|---|
protected LazyBSONCallback |
_callback
|
protected int |
_doc_start_offset
|
protected BSONByteBuffer |
_input
|
Constructor Summary | |
---|---|
LazyBSONObject(BSONByteBuffer buffer,
int offset,
LazyBSONCallback callback)
|
|
LazyBSONObject(BSONByteBuffer buffer,
LazyBSONCallback callback)
|
|
LazyBSONObject(byte[] data,
int offset,
LazyBSONCallback callback)
|
|
LazyBSONObject(byte[] data,
LazyBSONCallback callback)
|
Method Summary | |
---|---|
boolean |
containsField(String s)
Checks if this object contains a field with the given name. |
boolean |
containsKey(String s)
Deprecated. |
Set<Map.Entry<String,Object>> |
entrySet()
This method will be more efficient than using a combination of keySet() and get(String key) |
boolean |
equals(Object o)
|
Object |
get(String key)
Gets a field from this object by a given name. |
int |
getBSONSize()
|
protected int |
getElementBSONSize(int offset)
|
protected byte |
getElementType(int offset)
|
protected Object |
getElementValue(org.bson.LazyBSONObject.ElementRecord record)
|
int |
hashCode()
|
protected boolean |
isElementEmpty(int offset)
|
boolean |
isEmpty()
|
Set<String> |
keySet()
Returns this object's fields' names |
int |
pipe(OutputStream os)
|
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. |
protected int |
sizeCString(int offset)
Returns the size of the BSON cstring at the given offset in the buffer |
Map |
toMap()
Returns a map representing this BSONObject. |
String |
toString()
Returns a JSON serialization of this object |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final int _doc_start_offset
protected final BSONByteBuffer _input
protected final LazyBSONCallback _callback
Constructor Detail |
---|
public LazyBSONObject(byte[] data, LazyBSONCallback callback)
public LazyBSONObject(byte[] data, int offset, LazyBSONCallback callback)
public LazyBSONObject(BSONByteBuffer buffer, LazyBSONCallback callback)
public LazyBSONObject(BSONByteBuffer buffer, int offset, LazyBSONCallback callback)
Method Detail |
---|
public Object put(String key, Object v)
BSONObject
put
in interface BSONObject
key
- Name to setv
- Corresponding value
public void putAll(BSONObject o)
BSONObject
putAll
in interface BSONObject
o
- the objectpublic void putAll(Map m)
BSONObject
putAll
in interface BSONObject
m
- the mappublic Object get(String key)
BSONObject
get
in interface BSONObject
key
- The name of the field fetch
public Map toMap()
BSONObject
toMap
in interface BSONObject
public Object removeField(String key)
BSONObject
removeField
in interface BSONObject
key
- The name of the field to remove
@Deprecated public boolean containsKey(String s)
BSONObject
containsKey
in interface BSONObject
public boolean containsField(String s)
BSONObject
containsField
in interface BSONObject
s
- Field name for which to check
public Set<String> keySet()
BSONObject
keySet
in interface BSONObject
public Set<Map.Entry<String,Object>> entrySet()
protected boolean isElementEmpty(int offset)
public boolean isEmpty()
public int getBSONSize()
public int pipe(OutputStream os) throws IOException
IOException
protected byte getElementType(int offset)
protected int getElementBSONSize(int offset)
protected int sizeCString(int offset)
offset
- the offset into the buffer
protected Object getElementValue(org.bson.LazyBSONObject.ElementRecord record)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |