Package net.automatalib.alphabet
Class FastAlphabet<I extends MutableNumericID>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- net.automatalib.common.util.nid.DynamicList<I>
-
- net.automatalib.alphabet.FastAlphabet<I>
-
- Type Parameters:
I- input symbol class.
- All Implemented Interfaces:
Iterable<I>,Collection<I>,Comparator<I>,IntFunction<I>,ToIntFunction<I>,List<I>,Alphabet<I>,GrowingAlphabet<I>,ArrayWritable<I>
public class FastAlphabet<I extends MutableNumericID> extends DynamicList<I> implements GrowingAlphabet<I>
A fast alphabet implementation, that assumes identifiers are stored directly in the input symbols.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description FastAlphabet()FastAlphabet(I... symbols)FastAlphabet(List<? extends I> symbols)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddSymbol(I a)intcompare(I o1, I o2)booleancontainsSymbol(I symbol)IgetSymbol(int index)intgetSymbolIndex(I symbol)FastAlphabet<I>reversed()-
Methods inherited from class net.automatalib.common.util.nid.DynamicList
add, clear, get, isEmpty, iterator, remove, remove, remove, safeGet, size, swap, writeToArray
-
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, 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, 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, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
FastAlphabet
public FastAlphabet()
-
FastAlphabet
@SafeVarargs public FastAlphabet(I... symbols)
-
-
Method Detail
-
addSymbol
public int addSymbol(I a)
- Specified by:
addSymbolin interfaceGrowingAlphabet<I extends MutableNumericID>
-
getSymbol
public I getSymbol(int index)
- Specified by:
getSymbolin interfaceAlphabet<I extends MutableNumericID>
-
getSymbolIndex
public int getSymbolIndex(I symbol)
- Specified by:
getSymbolIndexin interfaceAlphabet<I extends MutableNumericID>
-
compare
public int compare(I o1, I o2)
- Specified by:
comparein interfaceAlphabet<I extends MutableNumericID>- Specified by:
comparein interfaceComparator<I extends MutableNumericID>
-
containsSymbol
public boolean containsSymbol(I symbol)
- Specified by:
containsSymbolin interfaceAlphabet<I extends MutableNumericID>
-
reversed
public FastAlphabet<I> reversed()
- Specified by:
reversedin interfaceComparator<I extends MutableNumericID>
-
-