 
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
+import mx.collections.IList;
 
 public class GridDimensions 
 {

     */
    public function moveRows(fromRow:int, toRow:int, count:int):void
    {
    }
    
    /**

        this.startY = 0;
        this.startY2 = 0;
    }
    
    /**
     *  Inserts count number of rows starting from startRow. This will increment 
     *  rowCount. If the nodes parameter is set, the nodes will be inserted
     *  to the rowList.
     */
    private function insertRowsAt(startRow:int, count:int, nodes:Vector.<GridRowNode> = null):void
    {
        if (startRow < 0 || count <= 0)
            return;
        
        var startNode:GridRowNode = rowList.findNearestLTE(startRow);
        var node:GridRowNode;
        
        // start on the index we're inserting at.
        if (startNode && startNode.rowIndex < startRow)
            startNode = startNode.next;
        
        // first we insert the nodes before this node.
        if (nodes)
        {
            for each (node in nodes)
            {
                rowList.insertBefore(startNode, node);
            }
        }
        
        // increment the index of nodes after this node.
        node = startNode;
        while (node)
        {
            node.rowIndex += count;
            node = node.next;
        }
        
        this.rowCount += count;
        
        // cache is invalid now.
        recentNode = null;
        recentNode2 = null;
    }
    
    /**
     *  Removes count number of rows starting from startRow. This will
     *  decrement rowCount. Returns any removed nodes.
     */
    private function removeRowsAt(startRow:int, count:int):Vector.<GridRowNode>
    {
        var vec:Vector.<GridRowNode> = new Vector.<GridRowNode>();
        if (startRow < 0 || count <= 0)
            return vec;
        
        var node:GridRowNode = rowList.findNearestLTE(startRow);
        var endRow:int = startRow + count;
        var oldNode:GridRowNode;
        
        if (node && node.rowIndex < startRow)
            node = node.next;
        
        while (node && node.rowIndex < endRow)
        {
            oldNode = node;
            vec.push(oldNode);
            node = node.next;
            rowList.removeNode(oldNode);
        }
        
        while (node)
        {
            node.rowIndex -= count;
            node = node.next;
        }
        
        this.rowCount -= count;
        
        // cache is invalid now.
        recentNode = null;
        recentNode2 = null;
        return vec;
    }
    
    /**
     *  Removes any nodes that occupy the indices between startRow
     *  and startRow + count.
     */
    private function clearRows(startRow:int, count:int):void
    {
        if (startRow < 0 || count <= 0)
            return;
        
        var node:GridRowNode = rowList.findNearestLTE(startRow);
        var endRow:int = startRow + count;
        var oldNode:GridRowNode;
        
        if (node && node.rowIndex < startRow)
            node = node.next;
        
        while (node && node.rowIndex < endRow)
        {
            oldNode = node;
            node = node.next;
            rowList.removeNode(oldNode);
        }
        
        // cache is invalid now.
        recentNode = null;
        recentNode2 = null;
    }

    /**
     *  Handles changes in the dataProvider.
     */
    public function dataProviderCollectionChanged(event:CollectionEvent):Boolean 
    {
        // TBD (klin): don't think we need to return booleans...
        switch (event.kind)
        {
            case CollectionEventKind.ADD:    return dataProviderCollectionAdd(event);
            case CollectionEventKind.REMOVE: return dataProviderCollectionRemove(event);
            case CollectionEventKind.REPLACE: return dataProviderCollectionReplace(event);
            case CollectionEventKind.MOVE: return dataProviderCollectionMove(event);
            case CollectionEventKind.REFRESH: return dataProviderCollectionReset(event);
            case CollectionEventKind.RESET: return dataProviderCollectionReset(event);
            case CollectionEventKind.UPDATE: return dataProviderCollectionReplace(event); return true;
                break;
        }
        
