Exemple #1
0
 /*
 ****************************************************************************
 * detach()
 ****************************************************************************
 */
 /**
  * Detaches this CacheNode from the queue.  Synchronized externally.
  */
 private void detach()
 {
     // remove yourself from the current spot in the list
     moPrev.moNext = moNext;
     moNext.moPrev = moPrev;
     moNext = null;
     moPrev = null;
 }
Exemple #2
0
 /*
 ****************************************************************************
 * Constructor()
 ****************************************************************************
 */
 /**
  *
  */
 internal CacheResult(CacheNode oNode, int nNumFound)
 {
     moLastCacheNode = oNode;
     mnNumFound = nNumFound;
 }
Exemple #3
0
 /*
 ****************************************************************************
 * Constructor()
 ****************************************************************************
 */
 /**
  * Creates a Cache structure with the specified maximum size
  */
 Cache(int nSize)
 {
     moRootNode = new CacheNode(this);
     mnMaxSize = nSize;
 }
Exemple #4
0
 /*
 ****************************************************************************
 * addToFront()
 ****************************************************************************
 */
 /**
  * Places this CacheNode in the front of the queue.  Synchronized externally.
  */
 private void addToFront()
 {
     // insert the new node right after the root node
     moPrev = moCache.moRootNode;
     moNext = moCache.moRootNode.moNext;
     moCache.moRootNode.moNext = this;
     moNext.moPrev = this;
 }
Exemple #5
0
        /*
        ****************************************************************************
        * Constructor()
        ****************************************************************************
        */
        /**
         *  This is used to add a new CacheNode to the cache
         */
        CacheNode(CacheNode oParent, string sSubsegment)
        {
            // we need to keep track of these for the removeSelf method
            moParent = oParent;
            msSubsegment = sSubsegment;
            moCache = oParent.moCache;
            moCache.increment();

            addToFront();
        }
Exemple #6
0
        /*
        ****************************************************************************
        * mkdir()
        ****************************************************************************
        */
        /**
         * Creates a CacheNode under this CacheNode for the specified subsegment
         */
        internal CacheNode mkdir(string sSubSegment)
        {
            CacheNode oNode = find(sSubSegment);
            if (oNode == null) {
                oNode = new CacheNode(this, sSubSegment);
                moCacheHash[sSubSegment] = oNode;
            }

            return oNode;
        }
Exemple #7
0
        Hashtable moCacheHash = new Hashtable(); // this was a synchronized object in java

        #endregion Fields

        #region Constructors

        /*
        ****************************************************************************
        * Constructor()
        ****************************************************************************
        */
        /**
         * This constructor is used only for the root node, makes a circular
         * doubly linked list
         */
        internal CacheNode(Cache oCache)
        {
            moCache = oCache;
            moNext = this;
            moPrev = this;
        }
Exemple #8
0
    /*
    ****************************************************************************
    * Constructor()
    ****************************************************************************
    */ /**
    *
    */
    CacheResult(CacheNode oNode, int nNumFound)
    {
        moLastCacheNode = oNode;
        mnNumFound = nNumFound;

    } // Constructor()
Exemple #9
0
    } // mkdir()

    /*
    ****************************************************************************
    * mkdir()
    ****************************************************************************
    */ /**
    * Creates a CacheNode under this CacheNode for the specified subsegment
    */
    CacheNode mkdir(String sSubSegment)
    {
        CacheNode oNode = find(sSubSegment);
        if (oNode == null)
        {
            oNode = new CacheNode(this, sSubSegment);
            moCacheHash.put(sSubSegment, oNode);
        }

        return oNode;

    } // mkdir()
Exemple #10
0
    /*
    ****************************************************************************
    * Constructor()
    ****************************************************************************
    */ /**
    * Creates a Cache structure with the specified maximum size
    */
    Cache(int nSize)
    {
        moRootNode = new CacheNode(this);
        mnMaxSize = nSize;

    } // Constructor()
Exemple #11
0
    /*
    ****************************************************************************
    * Constructor()
    ****************************************************************************
    */ /**
    * This constructor is used only for the root node, makes a circular
    * doubly linked list
    */
    CacheNode(Cache oCache)
    {
        moCache = oCache;
        moNext = this;
        moPrev = this;

    } // Constructor()