public abstract class AbstractVPDAlphabet<I> extends AbstractAlphabet<I> implements VPDAlphabet<I>
VPDAlphabet.SymbolType
modCount
Constructor and Description |
---|
AbstractVPDAlphabet(Alphabet<I> internalAlphabet,
Alphabet<I> callAlphabet,
Alphabet<I> returnAlphabet) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsSymbol(I symbol)
Checks whether the given symbol is part of the alphabet.
|
Alphabet<I> |
getCallAlphabet() |
I |
getCallSymbol(int index)
The
Alphabet.getSymbol(int) variant for the call alphabet. |
int |
getCallSymbolIndex(I symbol)
The
Alphabet.getSymbolIndex(Object) variant for the call alphabet. |
Alphabet<I> |
getInternalAlphabet() |
I |
getInternalSymbol(int index)
The
Alphabet.getSymbol(int) variant for the internal alphabet. |
int |
getInternalSymbolIndex(I symbol)
The
Alphabet.getSymbolIndex(Object) variant for the internal alphabet. |
int |
getNumCalls() |
int |
getNumInternals() |
int |
getNumReturns() |
Alphabet<I> |
getReturnAlphabet() |
I |
getReturnSymbol(int index)
The
Alphabet.getSymbol(int) variant for the return alphabet. |
int |
getReturnSymbolIndex(I symbol)
The
Alphabet.getSymbolIndex(Object) variant for the return 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.
|
VPDAlphabet.SymbolType |
getSymbolType(I symbol)
Returns the
symbol type of the given alphabet symbol. |
int |
size()
The size of this container.
|
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, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
callReturnBalance, 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 Alphabet<I> getCallAlphabet()
getCallAlphabet
in interface VPDAlphabet<I>
public I getCallSymbol(int index)
VPDAlphabet
Alphabet.getSymbol(int)
variant for the call alphabet.getCallSymbol
in interface VPDAlphabet<I>
index
- the index of the symbolpublic int getCallSymbolIndex(I symbol)
VPDAlphabet
Alphabet.getSymbolIndex(Object)
variant for the call alphabet.getCallSymbolIndex
in interface VPDAlphabet<I>
symbol
- the symbol whose index should be determinedpublic int getNumCalls()
getNumCalls
in interface VPDAlphabet<I>
public Alphabet<I> getInternalAlphabet()
getInternalAlphabet
in interface VPDAlphabet<I>
public I getInternalSymbol(int index)
VPDAlphabet
Alphabet.getSymbol(int)
variant for the internal alphabet.getInternalSymbol
in interface VPDAlphabet<I>
index
- the index of the symbolpublic int getInternalSymbolIndex(I symbol)
VPDAlphabet
Alphabet.getSymbolIndex(Object)
variant for the internal alphabet.getInternalSymbolIndex
in interface VPDAlphabet<I>
symbol
- the symbol whose index should be determinedpublic int getNumInternals()
getNumInternals
in interface VPDAlphabet<I>
public Alphabet<I> getReturnAlphabet()
getReturnAlphabet
in interface VPDAlphabet<I>
public I getReturnSymbol(int index)
VPDAlphabet
Alphabet.getSymbol(int)
variant for the return alphabet.getReturnSymbol
in interface VPDAlphabet<I>
index
- the index of the symbolpublic int getReturnSymbolIndex(I symbol)
VPDAlphabet
Alphabet.getSymbolIndex(Object)
variant for the return alphabet.getReturnSymbolIndex
in interface VPDAlphabet<I>
symbol
- the symbol whose index should be determinedpublic int getNumReturns()
getNumReturns
in interface VPDAlphabet<I>
public VPDAlphabet.SymbolType getSymbolType(I symbol)
VPDAlphabet
symbol type
of the given alphabet symbol.getSymbolType
in interface VPDAlphabet<I>
symbol
- the symbol whose type should be returnedsymbol type
of the given alphabet symbol.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>
symbol
- the symbol whose index should be determinedpublic 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 © 2020. All rights reserved.