Code example for LinkedList

Methods: addLast

0
            cur().put(name, new DBRef(_db, ns, id));
    } 
 
    @Override 
    public void objectStart(boolean array, String name){
        _nameStack.addLast(name);
        super.objectStart( array , name );
    } 
 
    @Override 
    public Object objectDone(){
        BSONObject o = (BSONObject)super.objectDone();
        String lastName = null;
        if ( _nameStack.size() > 0 ){
            lastName = _nameStack.removeLast();
        } 
        if ( ! ( o instanceof List ) && lastName != null &&
             o.containsField( "$ref" ) &&
             o.containsField( "$id" ) ){
            return cur().put(lastName, new DBRef( _db, o ) );
        }