MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / removeRange

Method removeRange

Ports/CLDC11/src/java/util/Vector.java:936–956  ·  view source on GitHub ↗
(int start, int end)

Source from the content-addressed store, hash-verified

934 /// if `start end` or
935 /// `end > size()`.
936 @Override
937 protected void removeRange(int start, int end) {
938 if (start >= 0 && start <= end && end <= elementCount) {
939 if (start == end) {
940 return;
941 }
942 if (end != elementCount) {
943 System.arraycopy(elementData, end, elementData, start,
944 elementCount - end);
945 int newCount = elementCount - (end - start);
946 Arrays.fill(elementData, newCount, elementCount, null);
947 elementCount = newCount;
948 } else {
949 Arrays.fill(elementData, start, elementCount, null);
950 elementCount = start;
951 }
952 modCount++;
953 } else {
954 throw new IndexOutOfBoundsException();
955 }
956 }
957
958 /// Removes all objects from this vector that are not contained in the
959 /// specified collection.

Callers

nothing calls this directly

Calls 2

arraycopyMethod · 0.95
fillMethod · 0.95

Tested by

no test coverage detected