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> |
withNewSymbol(Alphabet<I> alphabet,
I symbol)
Returns an alphabet, which consists of the original alphabet including new input symbol.
|
@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> withNewSymbol(Alphabet<I> alphabet, I symbol)
GrowingAlphabet
, its GrowingAlphabet.addSymbol(Object)
is invoked and the
very same instance is returned. Otherwise a new (generic) GrowingAlphabet
instance is created and all
symbols are added.I
- input symbol typealphabet
- the source alphabet to extendsymbol
- the input symbol to addCopyright © 2018. All rights reserved.