I
- input symbol typepublic class GrowingVPDAlphabet<I> extends AbstractVPDAlphabet<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) |
VPDSym<I> |
getCallSymbol(int index)
The
Alphabet.getSymbol(int) variant for the call alphabet. |
int |
getCallSymbolIndex(VPDSym<I> symbol)
The
Alphabet.getSymbolIndex(Object) variant for the call alphabet. |
Collection<VPDSym<I>> |
getCallSymbols() |
VPDSym<I> |
getInternalSymbol(int index)
The
Alphabet.getSymbol(int) variant for the internal alphabet. |
int |
getInternalSymbolIndex(VPDSym<I> symbol)
The
Alphabet.getSymbolIndex(Object) variant for the internal alphabet. |
Collection<VPDSym<I>> |
getInternalSymbols() |
int |
getNumCalls() |
int |
getNumInternals() |
int |
getNumReturns() |
VPDSym<I> |
getReturnSymbol(int index)
The
Alphabet.getSymbol(int) variant for the return alphabet. |
int |
getReturnSymbolIndex(VPDSym<I> symbol)
The
Alphabet.getSymbolIndex(Object) variant for the return alphabet. |
Collection<VPDSym<I>> |
getReturnSymbols() |
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) |
int |
size()
The size of this container.
|
getCallAlphabet, getInternalAlphabet, getReturnAlphabet
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, isCallMatched, isCallSymbol, isInternalSymbol, isReturnMatched, isReturnSymbol, isWellMatched, longestWellMatchedPrefix, longestWellMatchedSuffix
apply, applyAsInt, compare, containsSymbol, 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> getSymbol(int index) throws IllegalArgumentException
Alphabet
index
- the index of the requested symbol.IllegalArgumentException
- if there is no symbol with this index.public int getSymbolIndex(VPDSym<I> symbol) throws IllegalArgumentException
Alphabet
IllegalArgumentException
- if the provided symbol does not belong to the alphabet.public VPDSym<I> getCallSymbol(int index) throws IllegalArgumentException
VPDAlphabet
Alphabet.getSymbol(int)
variant for the call alphabet.IllegalArgumentException
public int getCallSymbolIndex(VPDSym<I> symbol) throws IllegalArgumentException
VPDAlphabet
Alphabet.getSymbolIndex(Object)
variant for the call alphabet.IllegalArgumentException
public Collection<VPDSym<I>> getCallSymbols()
public VPDSym<I> getInternalSymbol(int index) throws IllegalArgumentException
VPDAlphabet
Alphabet.getSymbol(int)
variant for the internal alphabet.IllegalArgumentException
public int getInternalSymbolIndex(VPDSym<I> symbol) throws IllegalArgumentException
VPDAlphabet
Alphabet.getSymbolIndex(Object)
variant for the internal alphabet.IllegalArgumentException
public Collection<VPDSym<I>> getInternalSymbols()
public VPDSym<I> getReturnSymbol(int index) throws IllegalArgumentException
VPDAlphabet
Alphabet.getSymbol(int)
variant for the return alphabet.IllegalArgumentException
public int getReturnSymbolIndex(VPDSym<I> symbol) throws IllegalArgumentException
VPDAlphabet
Alphabet.getSymbolIndex(Object)
variant for the return alphabet.IllegalArgumentException
public Collection<VPDSym<I>> getReturnSymbols()
public int getNumCalls()
public int getNumInternals()
public int getNumReturns()
public VPDAlphabet.SymbolType getSymbolType(VPDSym<I> symbol)
public int size()
ArrayWritable
public VPDSym<I> addNewSymbol(I userObject, VPDAlphabet.SymbolType type)
Copyright © 2018. All rights reserved.