Class GridStringBuilder

java.lang.Object
org.apache.ignite.internal.util.GridStringBuilder
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SBLimitedLength

public class GridStringBuilder extends Object implements Serializable
Optimized string builder with better API.
See Also:
  • Constructor Details

  • Method Details

    • setLength

      public void setLength(int len)
      Parameters:
      len - Length to set.
    • impl

      public StringBuilder impl()
      Gets underlying implementation.
      Returns:
      Underlying implementation.
    • length

      public int length()
      Returns:
      Buffer length.
    • a

      public GridStringBuilder a(Object obj)
      Parameters:
      obj - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(String str)
      Parameters:
      str - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      Parameters:
      sb - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      Parameters:
      s - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(CharSequence s, int start, int end)
      Parameters:
      s - Element to add.
      start - Start position.
      end - End position.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(char[] str)
      Parameters:
      str - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(char[] str, int offset, int len)
      Parameters:
      str - Element to add.
      offset - Start offset.
      len - Length.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(boolean b)
      Parameters:
      b - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(char c)
      Parameters:
      c - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(int i)
      Parameters:
      i - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(long lng)
      Parameters:
      lng - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(float f)
      Parameters:
      f - Element to add.
      Returns:
      This buffer for chaining method calls.
    • a

      public GridStringBuilder a(double d)
      Parameters:
      d - Element to add.
      Returns:
      This buffer for chaining method calls.
    • appendCodePoint

      public GridStringBuilder appendCodePoint(int codePoint)
      Parameters:
      codePoint - Element to add.
      Returns:
      This buffer for chaining method calls.
    • d

      public GridStringBuilder d(int start, int end)
      Parameters:
      start - Start position to delete from.
      end - End position.
      Returns:
      This buffer for chaining method calls.
    • d

      public GridStringBuilder d(int index)
      Parameters:
      index - Index to delete character at.
      Returns:
      This buffer for chaining method calls.
    • nl

      public GridStringBuilder nl()
      Adds a platform-dependent newline to this buffer.
      Returns:
      This buffer for chaining method calls.
    • r

      public GridStringBuilder r(int start, int end, String str)
      Parameters:
      start - Start position to replace from.
      end - End position.
      str - String to replace with.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int index, char[] str, int off, int len)
      Parameters:
      index - Start index to insert to.
      str - String to insert.
      off - Offset in the string to be inserted.
      len - Length of the substring to be inserted.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, Object obj)
      Parameters:
      off - Offset to be inserted at.
      obj - Object whose string representation to be inserted.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, String str)
      Parameters:
      off - Offset to insert at.
      str - String to be inserted.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, char[] str)
      Parameters:
      off - Offset to insert at.
      str - String to be inserted.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int dstOff, CharSequence s)
      Parameters:
      dstOff - Offset to insert at.
      s - String to insert.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int dstOff, CharSequence s, int start, int end)
      Parameters:
      dstOff - Offset to insert at.
      s - String to insert.
      start - Start index to insert from.
      end - End index to insert up to.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, boolean b)
      Parameters:
      off - Offset to insert at.
      b - Element to insert.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, char c)
      Parameters:
      off - Offset to insert at.
      c - Element to insert.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, int i)
      Parameters:
      off - Offset to insert at.
      i - Element to insert.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, long l)
      Parameters:
      off - Offset to insert at.
      l - Element to insert.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, float f)
      Parameters:
      off - Offset to insert at.
      f - Element to insert.
      Returns:
      This buffer for chaining method calls.
    • i

      public GridStringBuilder i(int off, double d)
      Parameters:
      off - Offset to insert at.
      d - Element to insert.
      Returns:
      This buffer for chaining method calls.
    • appendHex

      public GridStringBuilder appendHex(long val)
      Appends given long value as a hex string to this string builder.
      Parameters:
      val - Value to append.
      Returns:
      This builder for chaining method calls.
    • appendHex

      public GridStringBuilder appendHex(int val)
      Appends given long value as a hex string to this string builder.
      Parameters:
      val - Value to append.
      Returns:
      This builder for chaining method calls.
    • toString

      public String toString()
      Overrides:
      toString in class Object