@Override public IntList visitIntList(IntList mine, IntList other) { if (!mine.equals(other)) { throw NOT_EQUALS; } return mine; }
@Override public IntList visitIntList(IntList mine, IntList other) { int size = mine.size(); int otherSize = other.size(); if (size > 0 && otherSize > 0) { if (!mine.isModifiable()) { mine = mine.mutableCopyWithCapacity(size + otherSize); } mine.addAll(other); } return size > 0 ? mine : other; }
@Override public IntList mutableCopyWithCapacity(int capacity) { if (capacity < size) { throw new IllegalArgumentException(); } return new IntArrayList(ArraysCompat.copyOf(array, capacity), size); }
@Override public IntList mutableCopyWithCapacity(int capacity) { if (capacity < size) { throw new IllegalArgumentException(); } return new IntArrayList(Arrays.copyOf(array, capacity), size); }
protected static IntList newIntList() { return new IntArrayList(); }
protected static IntList newIntList(List<Integer> toCopy) { return new IntArrayList(toCopy); }
protected static IntList emptyIntList() { return IntArrayList.emptyList(); }
protected static IntList mutableCopy(IntList list) { int size = list.size(); return list.mutableCopyWithCapacity( size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); }
@Override public IntList visitIntList(IntList mine, IntList other) { hashCode = (53 * hashCode) + mine.hashCode(); return mine; }
IntList visitIntList(IntList mine, IntList other);