public virtual Token Next() { if (tokenWrapper == null) { throw new System.NotSupportedException("This TokenStream only supports the new Attributes API."); } Token nextToken; if (supportedMethods.hasIncrementToken) { Token savedDelegate = tokenWrapper.delegate_Renamed; tokenWrapper.delegate_Renamed = new Token(); nextToken = IncrementToken()?tokenWrapper.delegate_Renamed:null; tokenWrapper.delegate_Renamed = savedDelegate; } else { System.Diagnostics.Debug.Assert(supportedMethods.hasReusableNext); nextToken = Next(new Token()); } if (nextToken != null) { Mono.Lucene.Net.Index.Payload p = nextToken.GetPayload(); if (p != null) { nextToken.SetPayload((Mono.Lucene.Net.Index.Payload)p.Clone()); } } return(nextToken); }
// like clear() but doesn't clear termBuffer/text private void ClearNoTermBuffer() { payload = null; positionIncrement = 1; flags = 0; startOffset = endOffset = 0; type = DEFAULT_TYPE; }
/// <summary> Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared.</summary> /// <param name="prototype"> /// </param> /// <param name="newTermBuffer"> /// </param> /// <param name="offset"> /// </param> /// <param name="length"> /// </param> public virtual void Reinit(Token prototype, char[] newTermBuffer, int offset, int length) { SetTermBuffer(newTermBuffer, offset, length); positionIncrement = prototype.positionIncrement; flags = prototype.flags; startOffset = prototype.startOffset; endOffset = prototype.endOffset; type = prototype.type; payload = prototype.payload; }
/// <summary> Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared.</summary> /// <param name="prototype"> /// </param> /// <param name="newTerm"> /// </param> public virtual void Reinit(Token prototype, System.String newTerm) { SetTermBuffer(newTerm); positionIncrement = prototype.positionIncrement; flags = prototype.flags; startOffset = prototype.startOffset; endOffset = prototype.endOffset; type = prototype.type; payload = prototype.payload; }
/// <summary>Shorthand for calling {@link #clear}, /// {@link #SetTermBuffer(char[], int, int)}, /// {@link #setStartOffset}, /// {@link #setEndOffset}, /// {@link #setType} /// </summary> /// <returns> this Token instance /// </returns> public virtual Token Reinit(char[] newTermBuffer, int newTermOffset, int newTermLength, int newStartOffset, int newEndOffset, System.String newType) { ClearNoTermBuffer(); payload = null; positionIncrement = 1; SetTermBuffer(newTermBuffer, newTermOffset, newTermLength); startOffset = newStartOffset; endOffset = newEndOffset; type = newType; return(this); }
/// <summary>Resets the term text, payload, flags, and positionIncrement, /// startOffset, endOffset and token type to default. /// </summary> public override void Clear() { payload = null; // Leave termBuffer to allow re-use termLength = 0; termText = null; positionIncrement = 1; flags = 0; startOffset = endOffset = 0; type = DEFAULT_TYPE; }
/// <summary> Copy the prototype token's fields into this one. Note: Payloads are shared.</summary> /// <param name="prototype"> /// </param> public virtual void Reinit(Token prototype) { prototype.InitTermBuffer(); SetTermBuffer(prototype.termBuffer, 0, prototype.termLength); positionIncrement = prototype.positionIncrement; flags = prototype.flags; startOffset = prototype.startOffset; endOffset = prototype.endOffset; type = prototype.type; payload = prototype.payload; }
/// <summary> Initialize this attribute with the given payload. </summary> public PayloadAttributeImpl(Payload payload) { this.payload = payload; }
/// <summary> Sets this Token's payload.</summary> public virtual void SetPayload(Payload payload) { this.payload = payload; }
public void SetPayload(Payload payload) { delegate_Renamed.SetPayload(payload); }
public override void Clear() { payload = null; }
/// <summary>Shorthand for calling {@link #clear}, /// {@link #SetTermBuffer(char[], int, int)}, /// {@link #setStartOffset}, /// {@link #setEndOffset}, /// {@link #setType} /// </summary> /// <returns> this Token instance /// </returns> public virtual Token Reinit(char[] newTermBuffer, int newTermOffset, int newTermLength, int newStartOffset, int newEndOffset, System.String newType) { ClearNoTermBuffer(); payload = null; positionIncrement = 1; SetTermBuffer(newTermBuffer, newTermOffset, newTermLength); startOffset = newStartOffset; endOffset = newEndOffset; type = newType; return this; }