FastBooleanBuffer
121122123124125126127128129130131132133
if (count == 0) { return this; } this.checkSizeLessThanCount(count); BooleanArrayList newDelegate = BooleanArrayList.newList(this.delegate); while (count > 0) { newDelegate.removeAtIndex(newDelegate.size() - 1); count--; } return BooleanStacks.immutable.with(newDelegate.toArray()); }
149150151152153154155156157158159160161162163
{ this.checkNegativeCount(count); this.checkSizeLessThanCount(count); if (count == 0) { return new BooleanArrayList(); } MutableBooleanList subList = new BooleanArrayList(count); int index = this.delegate.size() - 1; for (int i = 0; i < count; i++) { subList.add(this.delegate.get(index - i)); } return subList; }
423424425426427428429430431432433434435436
} public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int size = in.readInt(); BooleanArrayList deserializedDelegate = new BooleanArrayList(size); for (int i = 0; i < size; i++) { deserializedDelegate.add(in.readBoolean()); } this.stack = ImmutableBooleanArrayStack.newStackFromTopToBottom(deserializedDelegate); }
317318319320321322323324325
} @Override public MutableBooleanList collectBoolean(BooleanFunction<? super T> booleanFunction) { BooleanArrayList result = new BooleanArrayList(this.size()); this.forEach(new CollectBooleanProcedure<T>(booleanFunction, result)); return result; }
129130131132133134135
return Bags.immutable.of(); } public MutableBooleanList toList() { return new BooleanArrayList(); }
9596979899100101102103104105
public BooleanList peek(int count) { this.checkNegativeCount(count); if (count == 0) { return new BooleanArrayList(0); } if (count == 1) { return BooleanArrayList.newListWith(this.element1); }
297298299300301302303304305
return result.toImmutable(); } public ImmutableBooleanList collectBoolean(BooleanFunction<? super T> booleanFunction) { BooleanArrayList result = new BooleanArrayList(); this.forEach(new CollectBooleanProcedure<T>(booleanFunction, result)); return result.toImmutable(); }
123124125126127128129
} public ImmutableBooleanList select(BooleanPredicate predicate) { return predicate.accept(this.element1) ? BooleanArrayList.newListWith(this.element1).toImmutable() : new BooleanArrayList().toImmutable(); }
128129130131132133134135
: new BooleanArrayList().toImmutable(); } public ImmutableBooleanList reject(BooleanPredicate predicate) { return predicate.accept(this.element1) ? new BooleanArrayList().toImmutable() : BooleanArrayList.newListWith(this.element1).toImmutable(); }
223224225226227228229230231
return this.element1 == element ? BooleanLists.immutable.with() : this; } public ImmutableBooleanList newWithAll(BooleanIterable elements) { BooleanArrayList arrayList = BooleanArrayList.newListWith(this.element1); arrayList.addAll(elements); return arrayList.toImmutable(); }