KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lucene > index > TermPositionVector


1 package org.apache.lucene.index;
2
3 /**
4  * Copyright 2004 The Apache Software Foundation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 /** Extends <code>TermFreqVector</code> to provide additional information about
20  * positions in which each of the terms is found. A TermPositionVector not necessarily
21  * contains both positions and offsets, but at least one of these arrays exists.
22  */

23 public interface TermPositionVector extends TermFreqVector {
24   
25     /** Returns an array of positions in which the term is found.
26      * Terms are identified by the index at which its number appears in the
27      * term String array obtained from the <code>indexOf</code> method.
28      * May return null if positions have not been stored.
29      */

30     public int[] getTermPositions(int index);
31   
32     /**
33      * Returns an array of TermVectorOffsetInfo in which the term is found.
34      * May return null if offsets have not been stored.
35      *
36      * @see org.apache.lucene.analysis.Token
37      *
38      * @param index The position in the array to get the offsets from
39      * @return An array of TermVectorOffsetInfo objects or the empty list
40      */

41     public TermVectorOffsetInfo [] getOffsets(int index);
42 }
Popular Tags