2 * Copyright 2004 The Apache Software Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Lucene
.Net
.Index
22 sealed class SegmentMergeInfo
25 internal int base_Renamed
;
26 internal TermEnum termEnum
;
27 internal IndexReader reader
;
28 private TermPositions postings
; // use getPositions()
29 private int[] docMap
; // use getDocMap()
31 internal SegmentMergeInfo(int b
, TermEnum te
, IndexReader r
)
39 // maps around deleted docs
40 internal int[] GetDocMap()
44 // build array which maps document numbers around deletions
45 if (reader
.HasDeletions())
47 int maxDoc
= reader
.MaxDoc();
48 docMap
= new int[maxDoc
];
50 for (int i
= 0; i
< maxDoc
; i
++)
52 if (reader
.IsDeleted(i
))
62 internal TermPositions
GetPositions()
66 postings
= reader
.TermPositions();
75 term
= termEnum
.Term();