21 using Term = Lucene.Net.Index.Term;
24 namespace Lucene.Net.Search.Spans
31 protected internal Term internalTerm;
36 this.internalTerm = term;
42 get {
return internalTerm; }
45 public override string Field
47 get {
return internalTerm.Field; }
50 public override void ExtractTerms(System.Collections.Generic.ISet<
Term> terms)
52 terms.Add(internalTerm);
55 public override System.String ToString(System.String field)
57 System.Text.StringBuilder buffer =
new System.Text.StringBuilder();
58 if (internalTerm.Field.Equals(field))
59 buffer.Append(internalTerm.Text);
62 buffer.Append(internalTerm.ToString());
65 return buffer.ToString();
68 public override int GetHashCode()
71 int result = base.GetHashCode();
72 result = prime * result + ((internalTerm == null)?0:internalTerm.GetHashCode());
76 public override bool Equals(System.Object obj)
80 if (!base.Equals(obj))
82 if (GetType() != obj.GetType())
85 if (internalTerm == null)
87 if (other.internalTerm != null)
90 else if (!internalTerm.Equals(other.internalTerm))
97 return new TermSpans(reader.TermPositions(internalTerm), internalTerm);