public int findStructureIndexByLineNumber(int lineNumber, boolean moveBefore) {
        lineNumber = lineNumber <= 0 ? 1 : lineNumber;
        lineNumber = lineNumber > getTotalLineNumber() ? getTotalLineNumber() : lineNumber;
        int index = -1;
        for (int i = 0; i < structureLine.size(); i++) {
            Line temp = structureLine.get(i);
            if (temp.getLineNumber() == lineNumber) {
                index = i;
                break;
            }
        }
        if (index == -1) {
            for (int i = 0; i < structureLine.size(); i++) {
                Line temp = structureLine.get(i);
                if (temp.getLineNumber() > lineNumber) {
                    if (moveBefore) {
                        index = i - 1;
                    } else {
                        index = i;
                    }
                    break;
                }
            }
        }
        return index;
    }