19 using System.Collections.Generic;
20 using Term = Lucene.Net.Index.Term;
23 namespace Lucene.Net.Search.Spans
32 protected internal Term term;
33 protected internal int internalDoc;
34 protected internal int freq;
35 protected internal int count;
36 protected internal int position;
42 this.internalPositions = positions;
47 public override bool Next()
51 if (!internalPositions.Next())
53 internalDoc =
int.MaxValue;
56 internalDoc = internalPositions.Doc;
57 freq = internalPositions.Freq;
60 position = internalPositions.NextPosition();
65 public override bool SkipTo(
int target)
67 if (!internalPositions.SkipTo(target))
69 internalDoc =
int.MaxValue;
73 internalDoc = internalPositions.Doc;
74 freq = internalPositions.Freq;
77 position = internalPositions.NextPosition();
83 public override int Doc()
88 public override int Start()
93 public override int End()
100 public override ICollection<byte[]> GetPayload()
102 byte[] bytes =
new byte[internalPositions.PayloadLength];
103 bytes = internalPositions.GetPayload(bytes, 0);
104 var val =
new System.Collections.Generic.List<byte[]>();
111 public override bool IsPayloadAvailable()
113 return internalPositions.IsPayloadAvailable;
116 public override System.String ToString()
118 return "spans(" + term.ToString() +
")@" + (internalDoc == - 1?
"START":((internalDoc == System.Int32.MaxValue)?
"END":internalDoc +
"-" + position));
123 get {
return internalPositions; }