paulirwin commented on code in PR #1049: URL: https://github.com/apache/lucenenet/pull/1049#discussion_r1859448972
########## src/Lucene.Net/Analysis/TokenAttributes/CharTermAttribute.cs: ########## @@ -62,35 +61,29 @@ public interface ICharTermAttribute : IAttribute, ICharSequence, IAppendable char[] ResizeBuffer(int newSize); /// <summary> - /// Gets or Sets the number of valid characters (in + /// Gets or sets the number of valid characters (length of the term) in /// the termBuffer array. - /// <seealso cref="SetLength(int)"/> - /// </summary> - new int Length { get; set; } // LUCENENET: To mimic StringBuilder, we allow this to be settable. - - // LUCENENET specific: Redefining this[] to make it settable - new char this[int index] { get; set; } - - /// <summary> - /// Set number of valid characters (length of the term) in - /// the termBuffer array. Use this to truncate the termBuffer + /// Use this setter to truncate the termBuffer /// or to synchronize with external manipulation of the termBuffer. /// Note: to grow the size of the array, /// use <see cref="ResizeBuffer(int)"/> first. - /// NOTE: This is exactly the same operation as calling the <see cref="Length"/> setter, the primary - /// difference is that this method returns a reference to the current object so it can be chained. - /// <code> - /// obj.SetLength(30).Append("hey you"); - /// </code> /// </summary> - /// <param name="length"> the truncated length </param> - ICharTermAttribute SetLength(int length); + /// <remarks> + /// LUCENENET: To mimic StringBuilder, we allow this to be settable. + /// This replaces the chainable SetLength method in the Java version. + /// </remarks> + /// <seealso cref="Lucene.Net.Analysis.TokenAttributes.Extensions.CharTermAttributeExtensions.SetLength(ICharTermAttribute, int)"/> + new int Length { get; set; } + + // LUCENENET specific: Redefining this[] to make it settable + new char this[int index] { get; set; } /// <summary> /// Sets the length of the termBuffer to zero. /// Use this method before appending contents. /// </summary> - ICharTermAttribute SetEmpty(); + /// <seealso cref="Lucene.Net.Analysis.TokenAttributes.Extensions.CharTermAttributeExtensions.SetEmpty(ICharTermAttribute)"/> + void Clear(); Review Comment: I think this is a good idea, and most implementations seem to be using the `Attribute` abstract class anyways, which requires implementing it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org