de.fxnn.brainfuck.tape.TapeEofBehaviour Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brainfuck Show documentation
Show all versions of brainfuck Show documentation
Playground for Brainfuck interpreters in Java.
The newest version!
package de.fxnn.brainfuck.tape;
import java.io.DataInput;
public enum TapeEofBehaviour {
THROWS {
@Override
public Integer getEofValue(Tape tape, DataInput input) throws TapeIOException {
throw new TapeIOException("Could not read from input [" + input + "] to tape [" + tape + "], as no more input data is available.");
}
},
READS_ZERO {
@Override
public Integer getEofValue(Tape tape, DataInput input) throws TapeIOException {
return 0;
}
},
READS_MINUS_ONE {
@Override
public Integer getEofValue(Tape tape, DataInput input) throws TapeIOException {
return -1;
}
};
public abstract Integer getEofValue(Tape tape, DataInput input) throws TapeIOException;
}