1 package org.apache.lucene.index; 2 3 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 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 |