I
- input symbol typepublic class SimpleAlphabet<I> extends AbstractAlphabet<I> implements GrowingAlphabet<I>
modCount
Constructor and Description |
---|
SimpleAlphabet() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(I a) |
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 |
get(int index) |
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.
|
Iterator<I> |
iterator() |
int |
size()
The size of this container.
|
add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
apply, applyAsInt, translateFrom, writeToArray
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
public boolean add(I a)
add
in interface Collection<I>
add
in interface List<I>
add
in class AbstractList<I>
public int addSymbol(I a)
GrowingAlphabet
addSymbol
in interface GrowingAlphabet<I>
public int size()
ArrayWritable
size
in interface Collection<I>
size
in interface List<I>
size
in interface ArrayWritable<I>
size
in class AbstractCollection<I>
public I getSymbol(int index)
Alphabet
public int getSymbolIndex(I symbol)
Alphabet
getSymbolIndex
in interface Alphabet<I>
public I get(int index)
public boolean containsSymbol(I symbol)
Alphabet
Caution: the default implementation is rather inefficient and should be overridden, if possible.
containsSymbol
in interface Alphabet<I>
symbol
- the symbol to checktrue
iff the symbol is part of the alphabetCopyright © 2015. All rights reserved.