class RangeCoordinate extends CellCoordinate {

    public static RangeCoordinate fromRange(String range) {
        RangeCoordinate coordinate = new RangeCoordinate();

        String rangeExpression = normalizeRange(range);

        if (rangeExpression.contains(":")) {
            String[] coordinates = rangeExpression.split(":", -1);

            coordinate.setRowStartIndex(getRowIndex(coordinates[0]));
            coordinate.setColumnStartIndex(getColumnIndex(coordinates[0]));
            coordinate.setRowEndIndex(getRowIndex(coordinates[1]) + 1);
            coordinate.setColumnEndIndex(getColumnIndex(coordinates[1]) + 1);
        } else {
            CellCoordinate cellCoordinate = CellCoordinate.fromCellId(rangeExpression);
            coordinate.setRowIndex(cellCoordinate.getRowIndex());
            coordinate.setColumnIndex(cellCoordinate.getColumnIndex());
            coordinate.setRowStartIndex(cellCoordinate.getRowIndex());
            coordinate.setColumnStartIndex(cellCoordinate.getColumnIndex());
            coordinate.setRowEndIndex(cellCoordinate.getRowIndex() + 1);
            coordinate.setColumnEndIndex(cellCoordinate.getColumnIndex() + 1);
        }

        return coordinate;
    }

    private  RangeCoordinate();

}