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