@Override public String toString() { StringBuilder builder = new StringBuilder(size() * 7); builder.append(array[start] ? "[true" : "[false"); for (int i = start + 1; i < end; i++) { builder.append(array[i] ? ", true" : ", false"); } return builder.append(']').toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(size() * 7); builder.append(array[start] ? "[true" : "[false"); for (int i = start + 1; i < end; i++) { builder.append(array[i] ? ", true" : ", false"); } return builder.append(']').toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(size() * 7); builder.append(array[start] ? "[true" : "[false"); for (int i = start + 1; i < end; i++) { builder.append(array[i] ? ", true" : ", false"); } return builder.append(']').toString(); }
@Override public List<Boolean> subList(int fromIndex, int toIndex) { int size = size(); checkPositionIndexes(fromIndex, toIndex, size); if (fromIndex == toIndex) { return Collections.emptyList(); } return new BooleanArrayAsList(array, start + fromIndex, start + toIndex); }
@Override public String toString() { StringBuilder builder = new StringBuilder(size() * 7); builder.append(array[start] ? "[true" : "[false"); for (int i = start + 1; i < end; i++) { builder.append(array[i] ? ", true" : ", false"); } return builder.append(']').toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(size() * 7); builder.append(array[start] ? "[true" : "[false"); for (int i = start + 1; i < end; i++) { builder.append(array[i] ? ", true" : ", false"); } return builder.append(']').toString(); }
@Override public List<Boolean> subList(int fromIndex, int toIndex) { int size = size(); checkPositionIndexes(fromIndex, toIndex, size); if (fromIndex == toIndex) { return Collections.emptyList(); } return new BooleanArrayAsList(array, start + fromIndex, start + toIndex); }
boolean[] toBooleanArray() { // Arrays.copyOfRange() requires Java 6 int size = size(); boolean[] result = new boolean[size]; System.arraycopy(array, start, result, 0, size); return result; }
@Override public boolean equals(@NullableDecl Object object) { if (object == this) { return true; } if (object instanceof BooleanArrayAsList) { BooleanArrayAsList that = (BooleanArrayAsList) object; int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if (array[start + i] != that.array[that.start + i]) { return false; } } return true; } return super.equals(object); }
@Override public boolean equals(@NullableDecl Object object) { if (object == this) { return true; } if (object instanceof BooleanArrayAsList) { BooleanArrayAsList that = (BooleanArrayAsList) object; int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if (array[start + i] != that.array[that.start + i]) { return false; } } return true; } return super.equals(object); }
@Override public List<Boolean> subList(int fromIndex, int toIndex) { int size = size(); checkPositionIndexes(fromIndex, toIndex, size); if (fromIndex == toIndex) { return Collections.emptyList(); } return new BooleanArrayAsList(array, start + fromIndex, start + toIndex); }
@Override public Boolean get(int index) { checkElementIndex(index, size()); return array[start + index]; }
@Override public Boolean set(int index, Boolean element) { checkElementIndex(index, size()); boolean oldValue = array[start + index]; // checkNotNull for GWT (do not optimize) array[start + index] = checkNotNull(element); return oldValue; }
@Override public List<Boolean> subList(int fromIndex, int toIndex) { int size = size(); checkPositionIndexes(fromIndex, toIndex, size); if (fromIndex == toIndex) { return Collections.emptyList(); } return new BooleanArrayAsList(array, start + fromIndex, start + toIndex); }
@Override public Boolean set(int index, Boolean element) { checkElementIndex(index, size()); boolean oldValue = array[start + index]; // checkNotNull for GWT (do not optimize) array[start + index] = checkNotNull(element); return oldValue; }
@Override public Boolean get(int index) { checkElementIndex(index, size()); return array[start + index]; }
@Override public boolean equals(@Nullable Object object) { if (object == this) { return true; } if (object instanceof BooleanArrayAsList) { BooleanArrayAsList that = (BooleanArrayAsList) object; int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if (array[start + i] != that.array[that.start + i]) { return false; } } return true; } return super.equals(object); }
@Override public Boolean set(int index, Boolean element) { checkElementIndex(index, size()); boolean oldValue = array[start + index]; // checkNotNull for GWT (do not optimize) array[start + index] = checkNotNull(element); return oldValue; }
@Override public Boolean get(int index) { checkElementIndex(index, size()); return array[start + index]; }
@Override public List<Boolean> subList(int fromIndex, int toIndex) { int size = size(); checkPositionIndexes(fromIndex, toIndex, size); if (fromIndex == toIndex) { return Collections.emptyList(); } return new BooleanArrayAsList(array, start + fromIndex, start + toIndex); }