{@inheritDoc}
(int fromIndex, int toIndex)
| 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} |