KickJava   Java API By Example, From Geeks To Geeks.

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


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 public class TermVectorOffsetInfo {
20     public static final TermVectorOffsetInfo [] EMPTY_OFFSET_INFO = new TermVectorOffsetInfo[0];
21     private int startOffset;
22     private int endOffset;
23
24   public TermVectorOffsetInfo() {
25   }
26
27   public TermVectorOffsetInfo(int startOffset, int endOffset) {
28     this.endOffset = endOffset;
29     this.startOffset = startOffset;
30   }
31
32   public int getEndOffset() {
33     return endOffset;
34   }
35
36   public void setEndOffset(int endOffset) {
37     this.endOffset = endOffset;
38   }
39
40   public int getStartOffset() {
41     return startOffset;
42   }
43
44   public void setStartOffset(int startOffset) {
45     this.startOffset = startOffset;
46   }
47
48   public boolean equals(Object JavaDoc o) {
49     if (this == o) return true;
50     if (!(o instanceof TermVectorOffsetInfo)) return false;
51
52     final TermVectorOffsetInfo termVectorOffsetInfo = (TermVectorOffsetInfo) o;
53
54     if (endOffset != termVectorOffsetInfo.endOffset) return false;
55     if (startOffset != termVectorOffsetInfo.startOffset) return false;
56
57     return true;
58   }
59
60   public int hashCode() {
61     int result;
62     result = startOffset;
63     result = 29 * result + endOffset;
64     return result;
65   }
66 }
67
Popular Tags