I
- input symbol class.public final class FastAlphabet<I extends MutableNumericID> extends DynamicList<I> implements GrowingAlphabet<I>
modCount
Constructor and Description |
---|
FastAlphabet() |
FastAlphabet(I... symbols) |
FastAlphabet(List<? extends I> symbols) |
Modifier and Type | Method and Description |
---|---|
int |
addSymbol(I a)
Adds a new symbol to the alphabet.
|
int |
compare(I o1,
I o2) |
boolean |
containsSymbol(I symbol)
Checks whether the given symbol is part of the alphabet.
|
I |
getSymbol(int index)
Returns the symbol with the given index in this alphabet.
|
int |
getSymbolIndex(I symbol)
Returns the index of the given symbol in the alphabet.
|
add, clear, get, isEmpty, iterator, remove, remove, remove, safeGet, size, swap, writeToArray
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
apply, applyAsInt, translateFrom, writeToArray
size
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
addAll, contains, containsAll, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
public FastAlphabet()
@SafeVarargs public FastAlphabet(I... symbols)
public int addSymbol(I a)
GrowingAlphabet
addSymbol
in interface GrowingAlphabet<I extends MutableNumericID>
public I getSymbol(int index)
Alphabet
getSymbol
in interface Alphabet<I extends MutableNumericID>
index
- the index of the requested symbol.public int getSymbolIndex(I symbol)
Alphabet
getSymbolIndex
in interface Alphabet<I extends MutableNumericID>
symbol
- the symbol whose index should be determinedpublic int compare(I o1, I o2)
compare
in interface Comparator<I extends MutableNumericID>
compare
in interface Alphabet<I extends MutableNumericID>
public boolean containsSymbol(I symbol)
Alphabet
Caution: the default implementation is rather inefficient and should be overridden, if possible.
containsSymbol
in interface Alphabet<I extends MutableNumericID>
symbol
- the symbol to checktrue
iff the symbol is part of the alphabetCopyright © 2020. All rights reserved.