The type-defining-script for CsoGateway.Collections.Bucket is located in file CsoGateway.Collections.Dictionary.js

Copy 
// File: CsoGateway.Collections.Dictionary.js
// Version: 0.7.1.0
// Author: Pascal Dufresne
// Date: 2008-12-03
// Last update: 2009-05-25
// http://csogateway.codeplex.com
// http://csogateway.metaobjects.ca
// Copyright (C) 2010 Pascal Dufresne

/*
 * Register CsoGateway.Collections namespace. Import CsoGateway.System namespace.
 */
Type.registerNamespace("CsoGateway.Collections");
ImportNamespace(CsoGateway.System);

Copy 
/*
 * CsoGateway.Collections.Bucket is a linked list holding key/value pairs of the
 * CsoGateway.Collections.Dictionary class.
 */

ImportType(CsoGateway.Collections.Entry);


CsoGateway.Collections.Bucket = function Bucket()
{    
    this.count = 0;
    this.first = null;
}

CsoGateway.Collections.Bucket.prototype.add = function(key, value)
{
    AssertArgumentNotNullOrUndefined(key, 'key in CsoGateway.Collections.Bucket.prototype.add');
    AssertArgumentNotUndefined(value, 'value in CsoGateway.Collections.Bucket.prototype.add');

    if(this.first != null)
    {
        var old;
        for(var e = this.first; e != null; e = e.next)
        {    
            //Key is found
            if(e.key == key)
            {    
                old = e.value;
                e.value = value;
                return old;
            }
        }
    }

    // Bucket empty or key not found
    this.first = new Entry(key, value, this.first);
    this.count++;

    return null;
}

CsoGateway.Collections.Bucket.prototype.remove = function(key)
{
    AssertArgumentNotNullOrUndefined(key, 'key in CsoGateway.Collections.Bucket.prototype.remove');

    if(this.first != null)
    {    
        for(var e = this.first, prev = null; e != null; prev = e, e = e.next)
        {    
            //Key is found
            if(e.key == key)
            {    
                if(prev == null)
                    this.first = e.next; // It's the first element
                else
                    prev.next = e.next; // Not the first element

                this.count--;

                return e.value; // return value removed
            }
        }
    }        

    return null; // return null if key not found
}

CsoGateway.Collections.Bucket.prototype.clear = function()
{    
    this.first = null;
    this.count = 0;
}
CsoGateway.Collections.Bucket.registerClass('CsoGateway.Collections.Bucket', CsoNative, Sys.IDisposable);

/*
 * End of CsoGateway.Collections.Bucket definition
 */