public class SourceCodeFormatter extends Object implements Appendable, CharSequence
| Constructor and Description |
|---|
SourceCodeFormatter(int indentSpaces)
Constructor to initialize the formatter with given indent spaces and sets the default indentation count to 0.
|
SourceCodeFormatter(int indentSpaces,
AtomicInteger indent)
Constructor to initialize the formatter with given indent spaces and an atomic integer value.
|
SourceCodeFormatter(int indentSpaces,
int i)
Constructor to initialize the formatter with given indent spaces and a specific integer value.
|
| Modifier and Type | Method and Description |
|---|---|
SourceCodeFormatter |
append(boolean flag)
Appends the provided boolean value to the formatted string.
|
SourceCodeFormatter |
append(char c) |
SourceCodeFormatter |
append(CharSequence csq) |
SourceCodeFormatter |
append(CharSequence csq,
int start,
int end) |
SourceCodeFormatter |
append(double d)
Appends the provided double value to the formatted string.
|
SourceCodeFormatter |
append(long i)
Appends the provided long value to the formatted string.
|
<Stringable> |
append(Stringable stringable)
Appends the provided object's string representation to the formatted string.
|
char |
charAt(int index) |
boolean |
contains(String text)
Checks if the formatted string contains the specified text.
|
int |
length()
Retrieves the length of the current formatted string.
|
void |
setLength(int len)
Sets the length of the current formatted string.
|
CharSequence |
subSequence(int start,
int end) |
@NotNull String |
toString()
Returns the formatted string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePointspublic SourceCodeFormatter(int indentSpaces,
AtomicInteger indent)
indentSpaces - Number of spaces to use for indentation.indent - Initial value for the atomic integer representing indentation count.public SourceCodeFormatter(int indentSpaces)
indentSpaces - Number of spaces to use for indentation.public SourceCodeFormatter(int indentSpaces,
int i)
indentSpaces - Number of spaces to use for indentation.i - Initial value for indentation count.@NotNull public @NotNull String toString()
toString in interface CharSequencetoString in class Objectpublic SourceCodeFormatter append(CharSequence csq)
append in interface Appendablepublic SourceCodeFormatter append(CharSequence csq, int start, int end)
append in interface Appendablepublic SourceCodeFormatter append(char c)
append in interface Appendablepublic void setLength(int len)
len - The new length for the formatted string.public int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic SourceCodeFormatter append(long i)
i - The long value to append.public SourceCodeFormatter append(double d)
d - The double value to append.public SourceCodeFormatter append(boolean flag)
flag - The boolean value to append.public <Stringable> SourceCodeFormatter append(Stringable stringable)
Stringable - The type of the object to be appended.stringable - The object whose string representation will be appended.public boolean contains(String text)
text - The text to search for within the formatted string.Copyright © 2024. All rights reserved.