public final class Alphabets extends Object
Modifier and Type | Method and Description |
---|---|
static Alphabet<Character> |
characters(char startInclusive,
char endInclusive) |
static Alphabet<String> |
closedCharStringRange(char startInclusive,
char endInclusive) |
static <T> Alphabet<T> |
fromArray(T... symbols) |
static <I> Alphabet<I> |
fromCollection(Collection<? extends I> coll) |
static <E extends Enum<E>> |
fromEnum(Class<E> enumClazz) |
static <E extends Enum<E>> |
fromEnum(Class<E> enumClazz,
boolean withNull) |
static <T> Alphabet<T> |
fromList(List<? extends T> list) |
static Alphabet<Integer> |
integers(int startInclusive,
int endInclusive) |
static <T> Alphabet<T> |
singleton(T symbol) |
static <I> GrowingAlphabet<I> |
toGrowingAlphabetOrThrowException(Alphabet<I> alphabet)
Casts the given alphabet to a
GrowingAlphabet if possible (i.e. the given alphabet is actually an
instance of a GrowingAlphabet ). |
@SafeVarargs public static <T> Alphabet<T> fromArray(T... symbols)
public static <E extends Enum<E>> Alphabet<E> fromEnum(Class<E> enumClazz, boolean withNull)
public static Alphabet<String> closedCharStringRange(char startInclusive, char endInclusive)
public static <T> Alphabet<T> singleton(T symbol)
public static <I> Alphabet<I> fromCollection(Collection<? extends I> coll)
public static <I> GrowingAlphabet<I> toGrowingAlphabetOrThrowException(Alphabet<I> alphabet) throws GrowingAlphabetNotSupportedException
GrowingAlphabet
if possible (i.e. the given alphabet is actually an
instance of a GrowingAlphabet
). Throws a GrowingAlphabetNotSupportedException
otherwise.I
- input symbol typealphabet
- the alphabet to castGrowingAlphabet
.GrowingAlphabetNotSupportedException
- if the given alphabet is not an instance of GrowingAlphabet
.Copyright © 2019. All rights reserved.