18 using Lucene.Net.Support;
21 namespace Lucene.Net.Index
30 private bool currentFieldStoresPayloads;
31 private readonly
long[] freqPointer;
32 private readonly
long[] proxPointer;
33 private readonly
int[] payloadLength;
35 private long lastFreqPointer;
36 private long lastProxPointer;
37 private int lastPayloadLength;
42 freqPointer =
new long[maxSkipLevels];
43 proxPointer =
new long[maxSkipLevels];
44 payloadLength =
new int[maxSkipLevels];
47 internal virtual void Init(
long skipPointer,
long freqBasePointer,
long proxBasePointer,
int df,
bool storesPayloads)
49 base.Init(skipPointer, df);
50 this.currentFieldStoresPayloads = storesPayloads;
51 lastFreqPointer = freqBasePointer;
52 lastProxPointer = proxBasePointer;
54 for (
int i = 0; i < freqPointer.Length; i++) freqPointer[i] = freqBasePointer;
55 for (
int i = 0; i < proxPointer.Length; i++) proxPointer[i] = proxBasePointer;
56 for (
int i = 0; i < payloadLength.Length; i++) payloadLength[i] = 0;
62 internal virtual long GetFreqPointer()
64 return lastFreqPointer;
70 internal virtual long GetProxPointer()
72 return lastProxPointer;
79 internal virtual int GetPayloadLength()
81 return lastPayloadLength;
84 protected internal override void SeekChild(
int level)
86 base.SeekChild(level);
87 freqPointer[level] = lastFreqPointer;
88 proxPointer[level] = lastProxPointer;
89 payloadLength[level] = lastPayloadLength;
92 protected internal override void SetLastSkipData(
int level)
94 base.SetLastSkipData(level);
95 lastFreqPointer = freqPointer[level];
96 lastProxPointer = proxPointer[level];
97 lastPayloadLength = payloadLength[level];
101 protected internal override int ReadSkipData(
int level,
IndexInput skipStream)
104 if (currentFieldStoresPayloads)
111 delta = skipStream.ReadVInt();
112 if ((delta & 1) != 0)
114 payloadLength[level] = skipStream.ReadVInt();
120 delta = skipStream.ReadVInt();
122 freqPointer[level] += skipStream.ReadVInt();
123 proxPointer[level] += skipStream.ReadVInt();