Exemple #1
0
        public HashList Set(Object key, Object value)
        {
            HashList result = this;

            if (result.mNext != result)
            {
                result = MakeCopy();
            }
            result.mDict[key] = value;
            return(result);
        }
Exemple #2
0
        public HashList Add(Object key, Object value)
        {
            HashList result = this;

            if (result.mNext != result)
            {
                result = MakeCopy();
            }
            result.mDict.Add(key, value);
            return(result);
        }
Exemple #3
0
        private HashList MakeCopy()
        {
            HashList result = new HashList();
            result.mDict = new Dictionary<object, object>(mDict);

            HashList next = mNext;
            while (next != this)
            {
                // Remove "this" from the reference chain
                if (next.mNext == this)
                    next.mNext = this.mNext;
            }

            return result;
        }
Exemple #4
0
        private HashList MakeCopy()
        {
            HashList result = new HashList();

            result.mDict = new Dictionary <object, object>(mDict);

            HashList next = mNext;

            while (next != this)
            {
                // Remove "this" from the reference chain
                if (next.mNext == this)
                {
                    next.mNext = this.mNext;
                }
            }

            return(result);
        }
Exemple #5
0
 private HashList(HashList list)
 {
     mDict = list.mDict;
     mNext = list.mNext;
     list.mNext = this;
 }
Exemple #6
0
 public HashList()
 {
     mNext = this;
 }
Exemple #7
0
 private HashList(HashList list)
 {
     mDict      = list.mDict;
     mNext      = list.mNext;
     list.mNext = this;
 }
Exemple #8
0
 public HashList()
 {
     mNext = this;
 }