private <I, SP, TP, A extends MutableAutomaton<?, I, ?, SP, TP>> A readAutomatonBody(Alphabet<I> alphabet, boolean deterministic, AutomatonCreator<? extends A, I> creator, BlockPropertyDecoder<? extends SP> spDecoder, SinglePropertyDecoder<? extends TP> tpDecoder) throws IOException { int numStates = in.readInt(); A result = creator.createAutomaton(alphabet, numStates); // this cast is required .. final MutableAutomaton<?, I, ?, SP, TP> resultWithCorrectType = result; if (deterministic) { decodeBodyDet(resultWithCorrectType, alphabet, numStates, spDecoder, tpDecoder); } else { decodeBodyNondet(resultWithCorrectType, alphabet, numStates, spDecoder, tpDecoder); } return result; }
private <I, SP, TP, A extends MutableAutomaton<?, I, ?, SP, TP>> A readAutomatonBody(Alphabet<I> alphabet, boolean deterministic, AutomatonCreator<? extends A, I> creator, BlockPropertyDecoder<? extends SP> spDecoder, SinglePropertyDecoder<? extends TP> tpDecoder) throws IOException { int numStates = in.readInt(); A result = creator.createAutomaton(alphabet, numStates); // this cast is required .. final MutableAutomaton<?, I, ?, SP, TP> resultWithCorrectType = result; if (deterministic) { decodeBodyDet(resultWithCorrectType, alphabet, numStates, spDecoder, tpDecoder); } else { decodeBodyNondet(resultWithCorrectType, alphabet, numStates, spDecoder, tpDecoder); } return result; }