Top Fields Methods
com.vladsch.flexmark.util.sequence

public Interface SequenceUtils

Known Direct Subinterfaces
com.vladsch.flexmark.util.sequence.IRichSequence
Annotations
@SuppressWarnings:unchecked
Imports
com.vladsch.flexmark.util.misc.CharPredicate, .Pair, org.jetbrains.annotations.Contract, .NotNull, .Nullable, java.text.NumberFormat, .ParsePosition, java.util.*, java.util.function.Predicate

Field Summary

Modifier and TypeField and Description
public static final String
public static final CharPredicate
ANY_EOL_SET

Deprecated
public static final CharPredicate
BACKSLASH_SET

Deprecated
public static final CharPredicate
DECIMAL_DIGITS

Deprecated
public static final int[]
public static final char
public static final String
public static final char
public static final char
public static final char
public static final String
EOL_CHARS

Deprecated
public static final CharPredicate
EOL_SET

Deprecated
public static final CharPredicate
HASH_SET

Deprecated
public static final CharPredicate
HEXADECIMAL_DIGITS

Deprecated
public static final String
public static final char
public static final char
LSEP

Deprecated use new names instead
public static final char
public static final String
public static final char
public static final CharPredicate
OCTAL_DIGITS

Deprecated
public static final String
public static final String
public static final CharPredicate
SPACE_EOL_SET

Deprecated
public static final CharPredicate
SPACE_SET

Deprecated use CharPredicate fields directly
public static final String
public static final CharPredicate
SPACE_TAB_EOL_SET

Deprecated
public static final CharPredicate
SPACE_TAB_NBSP_SET

Deprecated
public static final CharPredicate
SPACE_TAB_SET

Deprecated
public static final char
public static final int
public static final int
public static final int
public static final int
public static final int
public static final CharPredicate
TAB_SET

Deprecated
public static final char
public static final String
public static final CharPredicate
US_SET

Deprecated
public static final Map<Character, String>
public static final String
public static final String
WHITESPACE_CHARS

Deprecated
public static final String
public static final String
public static final CharPredicate
public static final String
public static final CharPredicate
WHITESPACE_SET

Deprecated

Method Summary

Modifier and TypeMethod and Description
public static @NotNull List<Range>
public static @NotNull List<Range>
public static @NotNull List<Range>
blankLinesRemovedRanges(@NotNull CharSequence thizz, int fromIndex, int endIndex)

public static @NotNull List<Range>
blankLinesRemovedRanges(@NotNull CharSequence thizz, @NotNull CharPredicate eolChars, int fromIndex, int endIndex)

public static int
public static int
public static int
public static int
compare(@Nullable CharSequence o1, @Nullable CharSequence o2, boolean ignoreCase)

public static int
compare(@Nullable CharSequence o1, @Nullable CharSequence o2, boolean ignoreCase, @Nullable CharPredicate ignoreChars)

public static int
public static <T extends CharSequence> boolean
containedBy(T[] items, @NotNull CharSequence element)

public static boolean
public static boolean
public static boolean
public static boolean
public static boolean
public static boolean
containsAnyNot(@NotNull CharSequence thizz, @NotNull CharPredicate s, int fromIndex, int endIndex)

public static int
public static int
public static int
countLeading(@NotNull CharSequence thizz, @NotNull CharPredicate chars, int fromIndex, int endIndex)

public static int
public static int
public static int
public static int
countLeadingNot(@NotNull CharSequence thizz, @NotNull CharPredicate chars, int startIndex, int endIndex)

public static int
public static int
public static int
countLeadingNotSpace(@NotNull CharSequence thizz, int startIndex, int endIndex)

public static int
public static int
public static int
countLeadingNotSpaceTab(@NotNull CharSequence thizz, int startIndex, int endIndex)

public static int
public static int
public static int
countLeadingNotWhitespace(@NotNull CharSequence thizz, int startIndex, int endIndex)

public static int
public static int
countLeadingSpace(@NotNull CharSequence thizz, int startIndex)

public static int
countLeadingSpace(@NotNull CharSequence thizz, int startIndex, int endIndex)

public static int
public static int
public static int
countLeadingSpaceTab(@NotNull CharSequence thizz, int startIndex, int endIndex)

public static int
public static int
public static int
countLeadingWhitespace(@NotNull CharSequence thizz, int startIndex, int endIndex)

public static int
countOfAny(@NotNull CharSequence thizz, @NotNull CharPredicate chars, int fromIndex)

public static int
public static int
countOfAny(@NotNull CharSequence thizz, @NotNull CharPredicate s, int fromIndex, int endIndex)

public static int
countOfAnyNot(@NotNull CharSequence thizz, @NotNull CharPredicate chars, int fromIndex, int endIndex)

public static int
public static int
public static int
public static int
public static int
public static int
public static int
public static int
public static int
countTrailing(@NotNull CharSequence thizz, @NotNull CharPredicate chars, int startIndex, int fromIndex)

public static int
public static int
public static int
countTrailingNot(@NotNull CharSequence thizz, @NotNull CharPredicate chars, int startIndex, int endIndex)

public static int
public static int
public static int
countTrailingNotSpace(@NotNull CharSequence thizz, int startIndex, int fromIndex)

public static int
public static int
public static int
countTrailingNotSpaceTab(@NotNull CharSequence thizz, int startIndex, int fromIndex)

public static int
public static int
public static int
countTrailingNotWhitespace(@NotNull CharSequence thizz, int startIndex, int fromIndex)

public static int
public static int
public static int
countTrailingSpace(@NotNull CharSequence thizz, int startIndex, int fromIndex)

public static int
public static int
public static int
countTrailingSpaceTab(@NotNull CharSequence thizz, int startIndex, int fromIndex)

public static int
public static int
public static int
countTrailingWhitespace(@NotNull CharSequence thizz, int startIndex, int fromIndex)

public static int
public static int
public static int
public static int
endOfLine(@NotNull CharSequence thizz, int index)

public static int
public static boolean
public static boolean
endsWith(@NotNull CharSequence thizz, @NotNull CharSequence suffix, boolean ignoreCase)

public static boolean
public static boolean
public static boolean
public static boolean
public static boolean
public static boolean
public static int
public static int
eolEndLength(@NotNull CharSequence thizz, int eolEnd)

public static @NotNull Range
eolEndRange(@NotNull CharSequence thizz, int eolEnd)

public static int
eolStartLength(@NotNull CharSequence thizz, int eolStart)

public static @NotNull Range
eolStartRange(@NotNull CharSequence thizz, int eolStart)

public static boolean

Returns:

true if character contents are equal
equals
(@NotNull CharSequence
char sequence to test for equality
thizz
,
Object
any character sequence
o
)

Equality comparison based on character content of this sequence, with quick fail resorting to content comparison only if length and hashCodes are equal

public static @NotNull int[]
expandTo(@NotNull int[] indices, int length, int step)

public static char
public static Map<Character, String>
public static int
public static int
public static int
public static int
indexOf(@NotNull CharSequence thizz, char c)

public static int
indexOf(@NotNull CharSequence thizz, char c, int fromIndex)

public static int
indexOf(@NotNull CharSequence thizz, char c, int fromIndex, int endIndex)

public static int
indexOf(@NotNull CharSequence thizz, @NotNull CharSequence s, int fromIndex, int endIndex)

public static @NotNull int[]
public static int
public static int
public static int
indexOfAny(@NotNull CharSequence thizz, @NotNull CharPredicate s, int fromIndex, int endIndex)

public static int
public static int
public static int
indexOfAnyNot(@NotNull CharSequence thizz, @NotNull CharPredicate s, int fromIndex, int endIndex)

public static int
public static int
indexOfNot(@NotNull CharSequence thizz, char c, int fromIndex)

public static int
indexOfNot(@NotNull CharSequence thizz, char c, int fromIndex, int endIndex)

public static boolean
public static boolean
public static boolean
public static boolean
public static boolean
public static char
public static int
public static int
public static int
public static int
lastIndexOf(@NotNull CharSequence thizz, char c, int fromIndex)

public static int
lastIndexOf(@NotNull CharSequence thizz, char c, int startIndex, int fromIndex)

public static int
lastIndexOf(@NotNull CharSequence thizz, @NotNull CharSequence s, int startIndex, int fromIndex)

public static int
public static int
public static int
lastIndexOfAny(@NotNull CharSequence thizz, @NotNull CharPredicate s, int startIndex, int fromIndex)

public static int
public static int
public static int
lastIndexOfAnyNot(@NotNull CharSequence thizz, @NotNull CharPredicate s, int startIndex, int fromIndex)

public static int
public static int
lastIndexOfNot(@NotNull CharSequence thizz, char c, int fromIndex)

public static int
lastIndexOfNot(@NotNull CharSequence thizz, char c, int startIndex, int fromIndex)

public static @NotNull Range
public static @NotNull Range
public static @NotNull Range
leadingBlankLinesRange(@NotNull CharSequence thizz, int fromIndex, int endIndex)

public static @NotNull Range
leadingBlankLinesRange(@NotNull CharSequence thizz, @NotNull CharPredicate eolChars, int fromIndex, int endIndex)

public static @NotNull Pair<Integer, Integer>
public static @NotNull Range
lineRangeAt(@NotNull CharSequence thizz, int index)

public static @NotNull Range
public static boolean
matchChars(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, boolean ignoreCase)

public static boolean
matchChars(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex)

public static boolean
matchChars(@NotNull CharSequence thizz, @NotNull CharSequence chars, boolean ignoreCase)

public static boolean
public static boolean
public static boolean
public static boolean
matchCharsReversed(@NotNull CharSequence thizz, @NotNull CharSequence chars, int endIndex, boolean ignoreCase)

public static boolean
public static boolean
public static int
matchedCharCount(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, int endIndex, boolean ignoreCase)

public static int
matchedCharCount(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, boolean ignoreCase)

public static int
matchedCharCount(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, int endIndex)

public static int
public static int
matchedCharCount(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, int endIndex, boolean fullMatchOnly, boolean ignoreCase)

public static int
matchedCharCountIgnoreCase(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, int endIndex)

public static int
public static int
matchedCharCountReversed(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, int fromIndex)

public static int
matchedCharCountReversed(@NotNull CharSequence thizz, @NotNull CharSequence chars, int fromIndex, boolean ignoreCase)

public static int
public static int
matchedCharCountReversed(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, int fromIndex, boolean ignoreCase)

public static int
matchedCharCountReversedIgnoreCase(@NotNull CharSequence thizz, @NotNull CharSequence chars, int startIndex, int fromIndex)

public static int
public static boolean
matches(@NotNull CharSequence thizz, @NotNull CharSequence chars, boolean ignoreCase)

public static boolean
public static boolean
public static @NotNull String
padEnd(@NotNull CharSequence thizz, int length, char pad)

public static @NotNull String
padEnd(@NotNull CharSequence thizz, int length)

public static @NotNull String
padStart(@NotNull CharSequence thizz, int length, char pad)

public static @NotNull String
padStart(@NotNull CharSequence thizz, int length)

public static int
parseIntOrDefault(String text, int defaultValue)

public static int
parseIntOrDefault(String text, int defaultValue, int radix)

public static Integer
public static Integer
parseIntOrNull(String text, int radix)

public static Long
public static Long
parseLongOrNull(String text, int radix)

public static @Nullable Number

Returns:

null or parsed number
parseNumberOrNull
(@Nullable String
text containing the number to parse
text
)

Parse number from text

Will parse 0x, 0b, octal if starts with 0, decimal

public static @Nullable Pair<Number, String>

Returns:

null or parsed number with unparsed suffix
parseNumberPrefixOrNull
(@Nullable String
text containing the number to parse
text
,
@Nullable Predicate<String>
predicate to test number suffix, if null or predicate returns true then sequence will be accepted as valid
suffixTester
)

Parse number from text

Will parse 0x, 0b, octal if starts with 0, decimal

public static int
parseUnsignedIntOrDefault(String text, int defaultValue)

public static int
parseUnsignedIntOrDefault(String text, int defaultValue, int radix)

public static Integer
public static Integer
parseUnsignedIntOrNull(String text, int radix)

public static char
safeCharAt(@NotNull CharSequence thizz, int index)

public static <T extends CharSequence> T[]
split(T thizz, T[] emptyArray, @NotNull CharSequence delimiter, boolean includeDelims, @Nullable CharPredicate trimChars)

public static <T extends CharSequence> T[]
split(T thizz, T[] emptyArray, @NotNull CharSequence delimiter)

public static <T extends CharSequence> T[]
split(T thizz, T[] emptyArray, @NotNull CharSequence delimiter, int limit, boolean includeDelims, @Nullable CharPredicate trimChars)

public static <T extends CharSequence> T[]
split(T thizz, T[] emptyArray, @NotNull CharSequence delimiter, int limit, int flags)

public static <T extends CharSequence> T[]
split(T thizz, T[] emptyArray, @NotNull CharSequence delimiter, int limit, int flags, @Nullable CharPredicate trimChars)

public static <T extends CharSequence> T[]
splitEOL(T thizz, T[] emptyArray)

public static <T extends CharSequence> T[]
splitEOL(T thizz, T[] emptyArray, boolean includeDelims)

public static <T extends CharSequence> @NotNull List<T>
splitList(T thizz, @NotNull CharSequence delimiter)

public static <T extends CharSequence> @NotNull List<T>
splitList(T thizz, @NotNull CharSequence delimiter, int limit, boolean includeDelims, @Nullable CharPredicate trimChars)

public static <T extends CharSequence> @NotNull List<T>
splitList(T thizz, @NotNull CharSequence delimiter, int limit, int flags)

public static <T extends CharSequence> @NotNull List<T>
splitList(T thizz, @NotNull CharSequence delimiter, boolean includeDelims, @Nullable CharPredicate trimChars)

public static <T extends CharSequence> @NotNull List<T>
splitList(T thizz, @NotNull CharSequence delimiter, int limit, int flags, @Nullable CharPredicate trimChars)

public static <T extends CharSequence> @NotNull List<T>
splitListEOL(T thizz)

public static <T extends CharSequence> @NotNull List<T>
splitListEOL(T thizz, boolean includeDelims)

public static <T extends CharSequence> @NotNull List<T>
splitListEOL(T thizz, boolean includeDelims, @Nullable CharPredicate trimChars)

public static int
public static int
public static int
public static int
startOfLine(@NotNull CharSequence thizz, int index)

public static int
public static boolean
public static boolean
startsWith(@NotNull CharSequence thizz, @NotNull CharSequence prefix, boolean ignoreCase)

public static boolean
public static boolean
public static boolean
public static boolean
public static boolean
public static boolean
public static <T extends CharSequence> T
subSequence(T thizz, int startIndex)

public static <
type of character sequence
T extends CharSequence
>
T

Returns:

sequence whose contents reflect the selected portion, if range.isNull() then this is returned
subSequence
(T
char sequence
thizz
,
@NotNull Range
range to get, coordinates offset form start of this sequence
range
)

Get a portion of this sequence selected by range

public static <
type of character sequence
T extends CharSequence
>
T

Returns:

sequence whose contents come after the selected range, if range.isNull() then null
subSequenceAfter
(T
char sequence
thizz
,
@NotNull Range
range to get, coordinates offset form start of this sequence
range
)

Get a portion of this sequence after one selected by range

public static <
type of character sequence
T extends CharSequence
>
T

Returns:

sequence whose contents come before the selected range, if range.isNull() then null
subSequenceBefore
(T
char sequence
thizz
,
@NotNull Range
range to get, coordinates offset form start of this sequence
range
)

Get a portion of this sequence before one selected by range

public static <
type of character sequence
T extends CharSequence
>
@NotNull Pair<T, T>

Returns:

sequence whose contents come before and after the selected range, if range.isNull() then pair of nulls
subSequenceBeforeAfter
(T
char sequence
thizz
,
Range
range to get, coordinates offset form start of this sequence
range
)

Get a portions of this sequence before and after one selected by range

public static @NotNull String[]
public static @NotNull String
public static @NotNull Range
public static @NotNull Range
public static @NotNull Range
trailingBlankLinesRange(@NotNull CharSequence thizz, int startIndex, int fromIndex)

public static @NotNull Range
trailingBlankLinesRange(@NotNull CharSequence thizz, @NotNull CharPredicate eolChars, int startIndex, int fromIndex)

public static <T extends CharSequence> T
trim(T thizz, @NotNull CharPredicate chars)

public static <T extends CharSequence> T
trim(T thizz, int keep)

public static <T extends CharSequence> T
trim(T thizz)

public static <T extends CharSequence> T
trim(T thizz, int keep, @NotNull CharPredicate chars)

public static <T extends CharSequence> T
trimEnd(T thizz, @NotNull CharPredicate chars)

public static <T extends CharSequence> T
trimEnd(T thizz, int keep)

public static <T extends CharSequence> T
trimEnd(T thizz)

public static <T extends CharSequence> T
trimEnd(T thizz, int keep, @NotNull CharPredicate chars)

public static Range
public static Range
public static Range
public static @NotNull Range
public static <T extends CharSequence> T
trimEOL(T thizz)

public static <T extends CharSequence> T
public static <T extends CharSequence> @NotNull Pair<T, T>
trimmed(T thizz, @NotNull CharPredicate chars)

public static <T extends CharSequence> @NotNull Pair<T, T>
trimmed(T thizz, int keep)

public static <T extends CharSequence> @NotNull Pair<T, T>
trimmed(T thizz)

public static <T extends CharSequence> @NotNull Pair<T, T>
trimmed(T thizz, int keep, @NotNull CharPredicate chars)

public static <T extends CharSequence> T
public static <T extends CharSequence> T
trimmedEnd(T thizz, int keep)

public static <T extends CharSequence> T
trimmedEnd(T thizz)

public static <T extends CharSequence> T
trimmedEnd(T thizz, int keep, @NotNull CharPredicate chars)

public static <T extends CharSequence> T
trimmedEOL(T thizz)

public static <T extends CharSequence> T
public static <T extends CharSequence> T
trimmedStart(T thizz, int keep)

public static <T extends CharSequence> T
trimmedStart(T thizz)

public static <T extends CharSequence> T
trimmedStart(T thizz, int keep, @NotNull CharPredicate chars)

public static Range
public static Range
trimRange(@NotNull CharSequence thizz, int keep)

public static Range
public static @NotNull Range
public static <T extends CharSequence> T
public static <T extends CharSequence> T
trimStart(T thizz, int keep)

public static <T extends CharSequence> T
trimStart(T thizz)

public static <T extends CharSequence> T
trimStart(T thizz, int keep, @NotNull CharPredicate chars)

public static Range
public static Range
public static Range
public static @NotNull Range
public static <T extends CharSequence> T
public static @NotNull int[]
truncateTo(@NotNull int[] indices, int length)

public static void
validateIndex(int index, int length)

public static void
validateIndexInclusiveEnd(int index, int length)

public static void
validateStartEnd(int startIndex, int endIndex, int length)