package file;

public class FilePositionTracker {

    private String fileName;
    private int lineNumber;
    private int columnNumber;

    public FilePositionTracker(String fileName) {
        this.fileName = fileName;
        this.lineNumber = 1;
        this.columnNumber = 0;
    }

    public FilePosition getCurrentPosition() {
        FilePosition currentPosition = new FilePosition(fileName);
        currentPosition.setLineNumber(lineNumber);
        currentPosition.setColumnNumber(columnNumber);

        return currentPosition;
    }

    public void incrementColumn() {
        columnNumber++;
    }

    public void incrementLine() {
        lineNumber++;
        columnNumber = 0;
    }

}