public <I, SP, TP, A extends MutableAutomaton<?, I, ?, SP, TP>> A readAutomaton(AutomatonType expectedType, Alphabet<I> alphabet, AutomatonCreator<? extends A, I> creator, BlockPropertyDecoder<? extends SP> spDecoder, SinglePropertyDecoder<? extends TP> tpDecoder) throws IOException { AutomatonType type = readHeader(); if (type != expectedType) { throw new AutomatonSerializationException(); } int alphabetSize = in.readInt(); if (alphabetSize != alphabet.size()) { throw new AutomatonSerializationException(); } return readAutomatonBody(alphabet, type.isDeterministic(), creator, spDecoder, tpDecoder); }
public <SP, TP, A extends MutableAutomaton<?, Integer, ?, SP, TP>> A readNativeAutomaton(AutomatonType expectedType, AutomatonCreator<? extends A, Integer> creator, BlockPropertyDecoder<? extends SP> spDecoder, SinglePropertyDecoder<? extends TP> tpDecoder) throws IOException { AutomatonType type = readHeader(); if (type != expectedType) { throw new AutomatonSerializationException(); } int alphabetSize = in.readInt(); if (alphabetSize <= 0) { throw new AutomatonSerializationException(); } Alphabet<Integer> alphabet = Alphabets.integers(0, alphabetSize - 1); return readAutomatonBody(alphabet, type.isDeterministic(), creator, spDecoder, tpDecoder); }
public <I, SP, TP, A extends MutableAutomaton<?, I, ?, SP, TP>> A readAutomaton(AutomatonType expectedType, Alphabet<I> alphabet, AutomatonCreator<? extends A, I> creator, BlockPropertyDecoder<? extends SP> spDecoder, SinglePropertyDecoder<? extends TP> tpDecoder) throws IOException { AutomatonType type = readHeader(); if (type != expectedType) { throw new AutomatonSerializationException(); } int alphabetSize = in.readInt(); if (alphabetSize != alphabet.size()) { throw new AutomatonSerializationException(); } return readAutomatonBody(alphabet, type.isDeterministic(), creator, spDecoder, tpDecoder); }
public <SP, TP, A extends MutableAutomaton<?, Integer, ?, SP, TP>> A readNativeAutomaton(AutomatonType expectedType, AutomatonCreator<? extends A, Integer> creator, BlockPropertyDecoder<? extends SP> spDecoder, SinglePropertyDecoder<? extends TP> tpDecoder) throws IOException { AutomatonType type = readHeader(); if (type != expectedType) { throw new AutomatonSerializationException(); } int alphabetSize = in.readInt(); if (alphabetSize <= 0) { throw new AutomatonSerializationException(); } Alphabet<Integer> alphabet = Alphabets.integers(0, alphabetSize - 1); return readAutomatonBody(alphabet, type.isDeterministic(), creator, spDecoder, tpDecoder); }