Class RepeatedSequence
java.lang.Object
com.vladsch.flexmark.util.sequence.RepeatedSequence
- All Implemented Interfaces:
CharSequence
CharSequence that repeats in a wraparound the given sequence.
Partial repeat occurs when start % length() >0 and/or end % length() >0
The hashCode is purposefully matched to the string equivalent or this.toString().hashCode()
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CharSequence
private final int
private int
static RepeatedSequence
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
RepeatedSequence
(CharSequence chars, int startIndex, int endIndex) -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) boolean
int
hashCode()
int
length()
static @NotNull CharSequence
of
(char c, int count) Deprecated.static @NotNull CharSequence
of
(@NotNull CharSequence chars, int count) Deprecated.static @NotNull CharSequence
of
(@NotNull CharSequence chars, int startIndex, int endIndex) Deprecated.static @NotNull CharSequence
ofSpaces
(int count) repeat
(int count) static @NotNull CharSequence
repeatOf
(char c, int count) static @NotNull CharSequence
repeatOf
(@NotNull CharSequence chars, int count) static @NotNull CharSequence
repeatOf
(@NotNull CharSequence chars, int startIndex, int endIndex) subSequence
(int startIndex, int endIndex) @NotNull String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Field Details
-
NULL
-
chars
-
startIndex
private final int startIndex -
endIndex
private final int endIndex -
hashCode
private int hashCode
-
-
Constructor Details
-
RepeatedSequence
-
-
Method Details
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
repeat
-
hashCode
public int hashCode() -
equals
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
ofSpaces
-
repeatOf
-
repeatOf
@NotNull public static @NotNull CharSequence repeatOf(@NotNull @NotNull CharSequence chars, int count) -
repeatOf
@NotNull public static @NotNull CharSequence repeatOf(@NotNull @NotNull CharSequence chars, int startIndex, int endIndex) -
of
Deprecated. -
of
@NotNull @Deprecated public static @NotNull CharSequence of(@NotNull @NotNull CharSequence chars, int count) Deprecated. -
of
@NotNull @Deprecated public static @NotNull CharSequence of(@NotNull @NotNull CharSequence chars, int startIndex, int endIndex) Deprecated.
-