public override Token Next(Token reusableToken) { System.Diagnostics.Debug.Assert(reusableToken != null); Token nextToken = input.Next(reusableToken); sink.Add(nextToken); return nextToken; }
public override Token Next(Token reusableToken) { System.Diagnostics.Debug.Assert(reusableToken != null); if (iter == null) iter = lst.GetEnumerator(); // Since this TokenStream can be reset we have to maintain the tokens as immutable if (iter.MoveNext()) { Token nextToken = (Token) iter.Current; return (Token) nextToken.Clone(); } return null; }
public virtual Token Next(Token reusableToken) { System.Diagnostics.Debug.Assert(reusableToken != null); if (tokenWrapper == null) throw new System.NotSupportedException("This TokenStream only supports the new Attributes API."); if (supportedMethods.hasIncrementToken) { tokenWrapper.delegate_Renamed = reusableToken; return IncrementToken()?tokenWrapper.delegate_Renamed:null; } else { System.Diagnostics.Debug.Assert(supportedMethods.hasNext); return Next(); } }
public override Token Next(Token reusableToken) { return base.Next(reusableToken); }
/// <summary> Override this method to cache only certain tokens, or new tokens based /// on the old tokens. /// /// </summary> /// <param name="t">The {@link Mono.Lucene.Net.Analysis.Token} to add to the sink /// </param> public virtual void Add(Token t) { if (t == null) return ; lst.Add((Token) t.Clone()); }
internal TokenWrapper(Token delegate_Renamed) { this.delegate_Renamed = delegate_Renamed; }
/// <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> 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>Makes a clone, but replaces the term buffer & /// start/end offset in the process. This is more /// efficient than doing a full clone (and then calling /// setTermBuffer) because it saves a wasted copy of the old /// termBuffer. /// </summary> public virtual Token Clone(char[] newTermBuffer, int newTermOffset, int newTermLength, int newStartOffset, int newEndOffset) { Token t = new Token(newTermBuffer, newTermOffset, newTermLength, newStartOffset, newEndOffset); t.positionIncrement = positionIncrement; t.flags = flags; t.type = type; if (payload != null) t.payload = (Payload) payload.Clone(); return t; }
public override Token Next(Token reusableToken) { return(base.Next(reusableToken)); }