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

            if (result.mNext != result)
            {
                result = MakeCopy();
            }
            result.mDict[key] = value;
            return(result);
        }
Example #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);
        }
Example #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;
        }
Example #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);
        }
Example #5
0
 private HashList(HashList list)
 {
     mDict = list.mDict;
     mNext = list.mNext;
     list.mNext = this;
 }
Example #6
0
 public HashList()
 {
     mNext = this;
 }
Example #7
0
 private HashList(HashList list)
 {
     mDict      = list.mDict;
     mNext      = list.mNext;
     list.mNext = this;
 }
Example #8
0
 public HashList()
 {
     mNext = this;
 }