Class AbstractLengthLimitedStringBuilder

java.lang.Object
com.atlassian.confluence.search.v2.extractor.util.AbstractLengthLimitedStringBuilder
Direct Known Subclasses:
StaticLengthLimitedStringBuilder

public abstract class AbstractLengthLimitedStringBuilder extends Object
This is a base class for string builders that limit their length.

Instances of this class are not safe for use by multiple threads.

Since:
8.0
  • Field Details

  • Method Details

    • setLength

      public void setLength(int l)
    • length

      public int length()
    • append

      public AbstractLengthLimitedStringBuilder append(char[] str, int offset, int len)
    • append

      public AbstractLengthLimitedStringBuilder append(char c)
    • append

    • remainingLength

      protected int remainingLength()
    • limit

      protected abstract int limit()
    • limitReached

      protected boolean limitReached(int length)
      Checks if appending length characters to the string builder will reach the limit.
      Parameters:
      length -
      Returns:
      true if the limit is reached, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • capacity

      public int capacity()
    • isLimitReached

      public boolean isLimitReached()