Use IRangeAddressBuilder to build IRangeAddress.


  • buildCell() - builds an address of a single cell;
  • buildRange() - returns a single cell or a range address depending on the size of the range.

Usage example

import com.intechcore.scomponents.scell.api.IScellApiResolver;
import com.intechcore.scomponents.scell.api.init.ScellApiEntryPoint;
import com.intechcore.scomponents.scell.api.spreadsheet.model.address.IRangeAddress;
import com.intechcore.scomponents.scell.api.spreadsheet.service.builder.IRangeAddressBuilder;

import java.util.concurrent.CompletableFuture;

public class TestApp {
    public static void main(String[] args) {
        ScellApiEntryPoint.getApiResolverAsync().thenAccept(resolver -> {
            IRangeAddressBuilder addressBuilder = resolver.resolve(IRangeAddressBuilder.class);

            IRangeAddress defaultAddress1 = addressBuilder.buildCell();
            IRangeAddress defaultAddress2 = addressBuilder.buildRange(); // both calls with default builder values will build single cell address A1

            IRangeAddressBuilder customBuilder = addressBuilder
                    .from(defaultAddress2)                               // taking existing address as source
                    .setBottomRight(3, 2);                               // setting bottom right corner of future range

            IRangeAddress customAddress1 = customBuilder.buildRange();   // will get address of cells range A1:B3
            IRangeAddress customAddress2 = customBuilder.buildCell();    // will get address of single cell A1

            IRangeAddress customAddress3 = addressBuilder
                    .buildRange();                                       // will get range A1:A4

            IRangeAddressBuilder parsedAddressBuilder = addressBuilder
                    .fromA1String("A1");                                 // parse cell address from string. Not empty if string represents correct address

            IRangeAddressBuilder parsedRangeBuilder = addressBuilder
                    .fromA1String("A1:B5");                               // parse cells range from string. Not empty if string represents correct range

        }).whenComplete((unused, throwable) -> {
            if (throwable != null) {

See also