Skip to content

Commit

Permalink
Implemented IAppendable as per J2N - https://github.com/NightOwl888/J…
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Condillac committed Apr 10, 2020
1 parent 4285e3d commit e737158
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ namespace Lucene.Net.Analysis.Util
/// <summary>
/// A StringBuilder that allows one to access the array.
/// </summary>
public class OpenStringBuilder : ICharSequence
public class OpenStringBuilder : IAppendable, ICharSequence
{
protected char[] m_buf;
protected int m_len;

public OpenStringBuilder()
public OpenStringBuilder()
: this(32)
{
}
Expand Down Expand Up @@ -73,7 +73,7 @@ public virtual void Set(char[] arr, int end)

public virtual int Capacity => m_buf.Length;

public virtual OpenStringBuilder Append(ICharSequence csq)
public virtual OpenStringBuilder Append(ICharSequence csq)
{
return Append(csq, 0, csq.Length);
}
Expand Down Expand Up @@ -270,5 +270,50 @@ public override string ToString()
{
return new string(m_buf, 0, Length);
}

IAppendable IAppendable.Append(char value)
{
return Append(value);
}

IAppendable IAppendable.Append(string value)
{
return Append(value);
}

IAppendable IAppendable.Append(string value, int startIndex, int count)
{
return Append(value, startIndex, count);
}

IAppendable IAppendable.Append(StringBuilder value)
{
return Append(value);
}

IAppendable IAppendable.Append(StringBuilder value, int startIndex, int count)
{
return Append(value, startIndex, count);
}

public IAppendable Append(char[] value)
{
return Append(value);
}

public IAppendable Append(char[] value, int startIndex, int count)
{
return Append(value, startIndex, count);
}

IAppendable IAppendable.Append(ICharSequence value)
{
return Append(value);
}

IAppendable IAppendable.Append(ICharSequence value, int startIndex, int count)
{
return Append(value, startIndex, count);
}
}
}

0 comments on commit e737158

Please sign in to comment.