public RangeInfo subListBorders(int size) {
        if (inclusive == null) throw new IllegalStateException("Should not call subListBorders on a non-inclusive aware IntRange");
        int tempFrom = from;
        if (tempFrom < 0) {
            tempFrom += size;
        }
        int tempTo = to;
        if (tempTo < 0) {
            tempTo += size;
        }
        if (tempFrom > tempTo) {
            return new RangeInfo(inclusive ? tempTo : tempTo + 1, tempFrom + 1, true);
        }
        return new RangeInfo(tempFrom, inclusive ? tempTo + 1 : tempTo, false);
    }
public RangeInfo subListBorders ( int size ) { if ( inclusive == null ) throw new IllegalStateException ( "Should not call subListBorders on a non-inclusive aware IntRange" ) ; int tempFrom = from ; if ( tempFrom < 0 ) { tempFrom += size ; } int tempTo = to ; if ( tempTo < 0 ) { tempTo += size ; } if ( tempFrom > tempTo ) { return new RangeInfo ( inclusive ? tempTo : tempTo + 1 , tempFrom + 1 , true ) ; } return new RangeInfo ( tempFrom , inclusive ? tempTo + 1 : tempTo , false ) ; }
A method for determining from and to information when using this IntRange to index an aggregate object of the specified size.
Normally only used internally within Groovy but useful if adding range indexing support for your own aggregates.

@param size the size of the aggregate being indexed
@return the calculated range information (with 1 added to the to value, ready for providing to subList