Class VarString

    • Constructor Detail

      • VarString

        public VarString()
    • Method Detail

      • addNonNull

        public static final void addNonNull​(VarString vs,
                                            Object object)
      • New

        public static final VarString New​(int initialMinimumCapacity)
      • add

        public final void add​(char[] chars,
                              int offset,
                              int length)
      • validateIndex

        public final void validateIndex​(int index)
      • validateRange

        public final void validateRange​(int offset,
                                        int length)
      • last

        public final char last()
      • first

        public final char first()
      • add

        public final VarString add​(char c)
      • add

        public final VarString add​(char c1,
                                   char c2)
      • add

        public final VarString add​(char c1,
                                   char c2,
                                   char c3)
      • add

        public final VarString add​(byte value)
      • add

        public final VarString add​(boolean value)
      • add

        public final VarString add​(short value)
      • add

        public final VarString add​(int value)
      • add

        public final VarString add​(float value)
      • add

        public final VarString add​(long value)
      • add

        public final VarString add​(double value)
      • add

        public final VarString add​(char[] chars)
      • addHexDec

        public final VarString addHexDec​(byte value)
      • addHexDec

        public final VarString addHexDec​(byte... bytes)
      • ensureFreeCapacity

        public final void ensureFreeCapacity​(int minimumFreeCapacity)
      • ensureCapacity

        public final void ensureCapacity​(int minimumCapacity)
      • addChars

        public final VarString addChars​(char... chars)
      • addFalse

        public final VarString addFalse()
      • set

        public final VarString set​(int index,
                                   char c)
      • setChars

        public final VarString setChars​(int index,
                                        char... c)
      • setLast

        public final VarString setLast​(char c)
      • surrogateCharReverse

        @Deprecated
        public final VarString surrogateCharReverse()
        Deprecated.
        not implemented yet. Currently just calls reverse().
        Not implemented yet.
        Returns:
        currenty exactely what reverse() returns.
        See Also:
        reverse()
      • indexOf

        public final int indexOf​(char c)
      • indexOf

        public final int indexOf​(char c,
                                 int offset)
      • indexOf

        public final int indexOf​(char[] chars)
      • indexOf

        public final int indexOf​(char[] chars,
                                 int offset)
      • indexOf

        public final int indexOf​(String s)
      • indexOf

        public final int indexOf​(String s,
                                 int offset)
      • indexOf

        public final int indexOf​(VarString vc)
      • indexOf

        public final int indexOf​(VarString vc,
                                 int offset)
      • contains

        public final boolean contains​(char c)
      • contains

        public final boolean contains​(char[] chars)
      • contains

        public final boolean contains​(String s)
      • contains

        public final boolean contains​(VarString vc)
      • lastIndexOf

        public final int lastIndexOf​(char c)
      • lastIndexOf

        public final int lastIndexOf​(char c,
                                     int offset)
      • count

        public final int count​(char c)
      • count

        public final int count​(char[] chars)
      • count

        public final int count​(String s)
      • count

        public final int count​(VarString vc)
      • deleteAt

        public final VarString deleteAt​(int index)
      • deleteLast

        public final VarString deleteLast()
      • deleteLast

        public final VarString deleteLast​(int n)
      • shrinkTo

        public final VarString shrinkTo​(int n)
      • toArray

        public final char[] toArray()
      • copyTo

        public final VarString copyTo​(char[] target,
                                      int targetOffset)
      • copyTo

        public final VarString copyTo​(int offset,
                                      char[] target,
                                      int targetOffset,
                                      int length)
      • isEmpty

        public final boolean isEmpty()
      • consolidate

        public final VarString consolidate()
      • truncateTo

        public final VarString truncateTo​(int newLength)
      • subsequence

        public final VarString subsequence​(int beginIndex,
                                           int endIndex)
      • substring

        public final String substring​(int beginIndex,
                                      int endIndex)
      • list

        public final VarString list​(String separator,
                                    boolean... listElements)
      • list

        public final VarString list​(String separator,
                                    byte... listElements)
      • list

        public final VarString list​(String separator,
                                    short... listElements)
      • list

        public final VarString list​(String separator,
                                    int... listElements)
      • list

        public final VarString list​(String separator,
                                    long... listElements)
      • list

        public final VarString list​(String separator,
                                    float... listElements)
      • list

        public final VarString list​(String separator,
                                    double... listElements)
      • list

        public final VarString list​(String separator,
                                    char... listElements)
      • clear

        public final VarString clear()
        Fills this instance's char storage completely with zeros and sets its size to 0. Only preferable to reset() for in-memory security reasons.
        Returns:
        this
      • reset

        public final VarString reset()
        Simply resets this instance by setting its size to 0 while leaving the actual char storage untouched.
        Returns:
        this
      • blank

        public final VarString blank​(int amount)
      • tab

        public final VarString tab​(int amount)
      • cr

        public final VarString cr​(int amount)
      • lf

        public final VarString lf​(int amount)
      • repeat

        public final VarString repeat​(int amount,
                                      char c)
      • repeat

        public final VarString repeat​(int amount,
                                      char[] chars)
      • equalsAt

        public final boolean equalsAt​(int index,
                                      char[] chars,
                                      int charsOffset,
                                      int charsLength)
      • endsWith

        public final boolean endsWith​(char c)
      • endsWith

        public final boolean endsWith​(char[] chars)
      • endsWith

        public final boolean endsWith​(String string)
      • padLeft

        public final VarString padLeft​(String s,
                                       int totalLength,
                                       char paddingChar)
      • padRight

        public final VarString padRight​(String s,
                                        int totalLength,
                                        char paddingChar)
      • replaceFirst

        public final VarString replaceFirst​(char sample,
                                            char replacement)
      • replaceFirst

        public final VarString replaceFirst​(char sample,
                                            char replacement,
                                            int offset)
      • replaceFirst

        public final VarString replaceFirst​(char sample,
                                            char replacement,
                                            int offset,
                                            int length)
      • replaceAll

        public final VarString replaceAll​(char sample,
                                          char replacement)
      • replaceAll

        public final VarString replaceAll​(char sample,
                                          char replacement,
                                          int offset)
      • replaceAll

        public final VarString replaceAll​(char sample,
                                          char replacement,
                                          int offset,
                                          int length)
      • split

        public final String[] split​(String regex,
                                    int limit)
      • encode

        public final byte[] encode()
        Alias for this.encodeBy(XFiles.standardCharset()); for general purpose encoding, with the "standard" being UTF-8 ( XFiles.utf8()), because any other charset is nonsense for a general case.
        Returns:
        the character data of this instance as an UTF-8 byte array.
        See Also:
        encodeBy(Charset)
      • encodeBy

        public final byte[] encodeBy​(Charset charset)
      • charAt

        public final char charAt​(int index)
        Specified by:
        charAt in interface CharSequence