@Override public DoubleList mutableCopyWithCapacity(int capacity) { if (capacity < size) { throw new IllegalArgumentException(); } return new DoubleArrayList(LegacyUtil.copyOf(array, capacity), size); }
@Override public DoubleList visitDoubleList(DoubleList mine, DoubleList other) { if (!mine.equals(other)) { throw NOT_EQUALS; } return mine; }
@Override public DoubleList visitDoubleList(DoubleList mine, DoubleList 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 DoubleList mutableCopyWithCapacity(int capacity) { if (capacity < size) { throw new IllegalArgumentException(); } return new DoubleArrayList(Arrays.copyOf(array, capacity), size); }
protected static DoubleList newDoubleList() { return new DoubleArrayList(); }
protected static DoubleList newDoubleList(List<Double> toCopy) { return new DoubleArrayList(toCopy); }
protected static DoubleList emptyDoubleList() { return DoubleArrayList.emptyList(); }
protected static DoubleList mutableCopy(DoubleList list) { int size = list.size(); return list.mutableCopyWithCapacity( size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); }
@Override public DoubleList visitDoubleList(DoubleList mine, DoubleList other) { hashCode = (53 * hashCode) + mine.hashCode(); return mine; }
DoubleList visitDoubleList(DoubleList mine, DoubleList other);