Lucene.Net.Index.SegmentInfos.Clone C# (CSharp) 메소드

Clone() 공개 메소드

Returns a copy of this instance, also copying each SegmentInfo.
public Clone ( ) : object
리턴 object
        public object Clone()
        {
            var sis = (SegmentInfos)base.MemberwiseClone();
            // deep clone, first recreate all collections:
            sis.segments = new List<SegmentCommitInfo>(Size());
            foreach (SegmentCommitInfo info in segments)
            {
                Debug.Assert(info.Info.Codec != null);
                // dont directly access segments, use add method!!!
                sis.Add((SegmentCommitInfo)(info.Clone()));
            }
            sis._userData = new Dictionary<string, string>(_userData);
            return sis;
        }

Usage Example

예제 #1
0
 /// <summary> Should internally checkpoint state that will change
 /// during commit so that we can rollback if necessary.
 /// </summary>
 internal virtual void  StartCommit()
 {
     if (directoryOwner)
     {
         rollbackSegmentInfos = (SegmentInfos)segmentInfos.Clone();
     }
     rollbackHasChanges = hasChanges;
 }
All Usage Examples Of Lucene.Net.Index.SegmentInfos::Clone