return new RangeImpl(ref, _sheet);
}
@Override
public long getCount() {
final Ref ref = getRefs().iterator().next();
final int col1 = ref.getLeftCol();
final int col2 = ref.getRightCol();
final int row1 = ref.getTopRow();
final int row2 = ref.getBottomRow();
if (ref.isWholeColumn()) {
return (long) (col2 - col1 + 1);
} else if (ref.isWholeRow()) {
return (long) (row2 - row1 + 1);
} else if (ref.isWholeSheet()) {
return 1L;
}
final int ccount = col2 - col1 + 1;
final long rcount = (long) (col2 - col1 + 1);
return rcount * ccount;