MCPcopy Index your code
hub / github.com/apache/groovy / subList

Method subList

src/main/java/groovy/lang/IntRange.java:453–470  ·  view source on GitHub ↗

{@inheritDoc}

(int fromIndex, int toIndex)

Source from the content-addressed store, hash-verified

451 * {@inheritDoc}
452 */
453 @Override
454 public List<Integer> subList(int fromIndex, int toIndex) {
455 if (fromIndex < 0) {
456 throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
457 }
458 if (toIndex > size()) {
459 throw new IndexOutOfBoundsException("toIndex = " + toIndex);
460 }
461 if (fromIndex > toIndex) {
462 throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
463 }
464
465 if (fromIndex == toIndex) {
466 return new EmptyRange<Integer>(getFrom());
467 }
468
469 return new IntRange(fromIndex + getFrom(), toIndex + getFrom() - 1, isReverse());
470 }
471
472 /**
473 * {@inheritDoc}

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.95
getFromMethod · 0.95
isReverseMethod · 0.95

Tested by

no test coverage detected