I
- input symbol typepublic class GrowingVPDAlphabet<I> extends AbstractVPDAlphabet<VPDSym<I>> implements VPDAlphabet<VPDSym<I>>
VPDAlphabet
implementation that allows to add new symbols after its construction.
Wraps input symbols in a VPDSym
instance to allow faster mappings from symbols to indexes.VPDAlphabet.SymbolType
modCount
Constructor and Description |
---|
GrowingVPDAlphabet() |
Modifier and Type | Method and Description |
---|---|
VPDSym<I> |
addNewSymbol(I userObject,
VPDAlphabet.SymbolType type) |
boolean |
containsSymbol(VPDSym<I> symbol)
Checks whether the given symbol is part of the alphabet.
|
VPDSym<I> |
getSymbol(int index)
Returns the symbol with the given index in this alphabet.
|
int |
getSymbolIndex(VPDSym<I> symbol)
Returns the index of the given symbol in the alphabet.
|
VPDAlphabet.SymbolType |
getSymbolType(VPDSym<I> symbol)
Returns the
symbol type of the given alphabet symbol. |
int |
size()
The size of this container.
|
getCallAlphabet, getCallSymbol, getCallSymbolIndex, getInternalAlphabet, getInternalSymbol, getInternalSymbolIndex, getNumCalls, getNumInternals, getNumReturns, getReturnAlphabet, getReturnSymbol, getReturnSymbolIndex
get
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
callReturnBalance, getCallAlphabet, getCallSymbol, getCallSymbolIndex, getInternalAlphabet, getInternalSymbol, getInternalSymbolIndex, getNumCalls, getNumInternals, getNumReturns, getReturnAlphabet, getReturnSymbol, getReturnSymbolIndex, isCallMatched, isCallSymbol, isInternalSymbol, isReturnMatched, isReturnSymbol, isWellMatched, longestWellMatchedPrefix, longestWellMatchedSuffix
apply, applyAsInt, compare, translateFrom, writeToArray
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, 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 VPDSym<I> addNewSymbol(I userObject, VPDAlphabet.SymbolType type)
public VPDAlphabet.SymbolType getSymbolType(VPDSym<I> symbol)
VPDAlphabet
symbol type
of the given alphabet symbol.getSymbolType
in interface VPDAlphabet<VPDSym<I>>
getSymbolType
in class AbstractVPDAlphabet<VPDSym<I>>
symbol
- the symbol whose type should be returnedsymbol type
of the given alphabet symbol.public int size()
ArrayWritable
public VPDSym<I> getSymbol(int index)
Alphabet
public int getSymbolIndex(VPDSym<I> symbol)
Alphabet
getSymbolIndex
in interface Alphabet<VPDSym<I>>
getSymbolIndex
in class AbstractVPDAlphabet<VPDSym<I>>
symbol
- the symbol whose index should be determinedpublic boolean containsSymbol(VPDSym<I> symbol)
Alphabet
Caution: the default implementation is rather inefficient and should be overridden, if possible.
containsSymbol
in interface Alphabet<VPDSym<I>>
containsSymbol
in class AbstractVPDAlphabet<VPDSym<I>>
symbol
- the symbol to checktrue
iff the symbol is part of the alphabetCopyright © 2020. All rights reserved.