Package net.automatalib.alphabet
Class GrowingMapAlphabet<I>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<I>
-
- net.automatalib.alphabet.AbstractAlphabet<I>
-
- net.automatalib.alphabet.MapAlphabet<I>
-
- net.automatalib.alphabet.GrowingMapAlphabet<I>
-
- Type Parameters:
I
- input symbol type
- All Implemented Interfaces:
Iterable<I>
,Collection<I>
,Comparator<I>
,IntFunction<I>
,ToIntFunction<I>
,List<I>
,Alphabet<I>
,GrowingAlphabet<I>
,ArrayWritable<I>
public class GrowingMapAlphabet<I> extends MapAlphabet<I> implements GrowingAlphabet<I>
An extension of theMapAlphabet
that also allows adding new symbol after construction.
-
-
Field Summary
-
Fields inherited from class net.automatalib.alphabet.MapAlphabet
indexMap, symbols
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description GrowingMapAlphabet()
GrowingMapAlphabet(Collection<? extends I> symbols)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(I a)
int
addSymbol(I a)
Adds a new symbol to the alphabet.-
Methods inherited from class net.automatalib.alphabet.MapAlphabet
containsSymbol, getSymbol, getSymbolIndex, size
-
Methods inherited from class net.automatalib.alphabet.AbstractAlphabet
get, reversed
-
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.automatalib.alphabet.Alphabet
apply, applyAsInt, compare, containsSymbol, getSymbol, getSymbolIndex, translateFrom, writeToArray
-
Methods inherited from interface net.automatalib.common.smartcollection.ArrayWritable
size
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
GrowingMapAlphabet
public GrowingMapAlphabet()
-
GrowingMapAlphabet
public GrowingMapAlphabet(Collection<? extends I> symbols)
-
-
Method Detail
-
add
public boolean add(I a)
- Specified by:
add
in interfaceCollection<I>
- Specified by:
add
in interfaceList<I>
- Overrides:
add
in classAbstractList<I>
-
addSymbol
public int addSymbol(I a)
Description copied from interface:GrowingAlphabet
Adds a new symbol to the alphabet. Some alphabets may prevent symbols from being added twice. In this case, the original alphabet remains unchanged, but this is not considered an error.- Specified by:
addSymbol
in interfaceGrowingAlphabet<I>
- Returns:
- the index of the symbol in the alphabet, after adding it.
-
-