예제 #1
0
        /// <summary>
        /// Returns a writable clone of this collection.
        /// </summary>
        public BTreeList <T> Clone()
        {
            BTreeList <T> copy = (BTreeList <T>)MemberwiseClone();

            copy._first      = copy._last = null;
            copy._root       = copy._root.Clone(ref copy._first, ref copy._last);
            copy._isReadOnly = false;
            return(copy);
        }
예제 #2
0
        /// <summary>
        /// Returns a read-only clone of this collection.  If this instance is already read-only the method will return this.
        /// </summary>
        public BTreeList <T> MakeReadOnly()
        {
            if (_isReadOnly)
            {
                return(this);
            }
            BTreeList <T> copy = Clone();

            copy._isReadOnly = true;
            return(copy);
        }