public CalendarCache getCacheItem(int iIndex)
    {
        if (m_modelCache == null)
            m_modelCache = new Vector<CalendarCache>();
        if (iIndex < m_modelCache.size())
        {
            // Check to make sure the cache matches
            return (CalendarCache)m_modelCache.elementAt(iIndex);
        }
        else if (iIndex == m_modelCache.size())
        {
            CalendarItem item = m_model.getItem(iIndex);
            if (item == null)
                return null;
            CalendarCache calCache = new CalendarCache(this, m_model, iIndex);
            if (iIndex < m_modelCache.size())  // HACK synchronization problem
                return this.getCacheItem(iIndex);   // If cache was updated while I messed around, return the correct item
            m_modelCache.addElement(calCache);
            return calCache;
        }
        else // if (i > m_modelCache.size())
        { // Need to populate the modelcache - BE CAREFUL this is recursive code
            for (int i = m_modelCache.size(); i <= iIndex; i++)
            {
                CalendarCache cacheItem = this.getCacheItem(i);
                if (cacheItem == null)
                    break;
                if (iIndex + 1 == i)
                    iIndex = m_model.getRowCount();     // This may have changed.
                if (i == iIndex)
                    return cacheItem;
            }
        }
        return null;    // ERROR
    }