Class RepeatedSequence
- java.lang.Object
-
- com.vladsch.flexmark.util.sequence.RepeatedSequence
-
- All Implemented Interfaces:
java.lang.CharSequence
public class RepeatedSequence extends java.lang.Object implements java.lang.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
Fields Modifier and Type Field Description private java.lang.CharSequence
chars
private int
endIndex
private int
hashCode
static RepeatedSequence
NULL
private int
startIndex
-
Constructor Summary
Constructors Modifier Constructor Description private
RepeatedSequence(java.lang.CharSequence chars, int startIndex, int endIndex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description char
charAt(int index)
boolean
equals(java.lang.Object obj)
int
hashCode()
int
length()
static @NotNull java.lang.CharSequence
of(char c, int count)
Deprecated.static @NotNull java.lang.CharSequence
of(@NotNull java.lang.CharSequence chars, int count)
Deprecated.static @NotNull java.lang.CharSequence
of(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)
Deprecated.static @NotNull java.lang.CharSequence
ofSpaces(int count)
RepeatedSequence
repeat(int count)
static @NotNull java.lang.CharSequence
repeatOf(char c, int count)
static @NotNull java.lang.CharSequence
repeatOf(@NotNull java.lang.CharSequence chars, int count)
static @NotNull java.lang.CharSequence
repeatOf(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)
java.lang.CharSequence
subSequence(int startIndex, int endIndex)
@NotNull java.lang.String
toString()
-
-
-
Field Detail
-
NULL
public static RepeatedSequence NULL
-
chars
private final java.lang.CharSequence chars
-
startIndex
private final int startIndex
-
endIndex
private final int endIndex
-
hashCode
private int hashCode
-
-
Method Detail
-
length
public int length()
- Specified by:
length
in interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int startIndex, int endIndex)
- Specified by:
subSequence
in interfacejava.lang.CharSequence
-
repeat
public RepeatedSequence repeat(int count)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
@NotNull public @NotNull java.lang.String toString()
- Specified by:
toString
in interfacejava.lang.CharSequence
- Overrides:
toString
in classjava.lang.Object
-
ofSpaces
@NotNull public static @NotNull java.lang.CharSequence ofSpaces(int count)
-
repeatOf
@NotNull public static @NotNull java.lang.CharSequence repeatOf(char c, int count)
-
repeatOf
@NotNull public static @NotNull java.lang.CharSequence repeatOf(@NotNull @NotNull java.lang.CharSequence chars, int count)
-
repeatOf
@NotNull public static @NotNull java.lang.CharSequence repeatOf(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int endIndex)
-
of
@NotNull @Deprecated public static @NotNull java.lang.CharSequence of(char c, int count)
Deprecated.
-
of
@NotNull @Deprecated public static @NotNull java.lang.CharSequence of(@NotNull @NotNull java.lang.CharSequence chars, int count)
Deprecated.
-
of
@NotNull @Deprecated public static @NotNull java.lang.CharSequence of(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int endIndex)
Deprecated.
-
-