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.CharSequenceCharSequence 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.CharSequencecharsprivate intendIndexprivate inthashCodestatic RepeatedSequenceNULLprivate intstartIndex
-
Constructor Summary
Constructors Modifier Constructor Description privateRepeatedSequence(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 charcharAt(int index)booleanequals(java.lang.Object obj)inthashCode()intlength()static @NotNull java.lang.CharSequenceof(char c, int count)Deprecated.static @NotNull java.lang.CharSequenceof(@NotNull java.lang.CharSequence chars, int count)Deprecated.static @NotNull java.lang.CharSequenceof(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)Deprecated.static @NotNull java.lang.CharSequenceofSpaces(int count)RepeatedSequencerepeat(int count)static @NotNull java.lang.CharSequencerepeatOf(char c, int count)static @NotNull java.lang.CharSequencerepeatOf(@NotNull java.lang.CharSequence chars, int count)static @NotNull java.lang.CharSequencerepeatOf(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)java.lang.CharSequencesubSequence(int startIndex, int endIndex)@NotNull java.lang.StringtoString()
-
-
-
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:
lengthin interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int startIndex, int endIndex)- Specified by:
subSequencein interfacejava.lang.CharSequence
-
repeat
public RepeatedSequence repeat(int count)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
@NotNull public @NotNull java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin 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.
-
-