public int size() { return adapter.size(); } public NSArray<T> subList(int start, int end) {
public int size() { return listAdapter.size(); } public NSOrderedSet<T> subList(int start, int end) {
/** * Removes all elements from this list, leaving it empty. * * @throws UnsupportedOperationException * if removing from this list is not supported. * @see List#isEmpty * @see List#size */ @Override public void clear() { removeRange(0, size()); }
/** * Adds the specified object at the end of this List. * * * @param object * the object to add * @return true * * @throws UnsupportedOperationException * if adding to this List is not supported * @throws ClassCastException * if the class of the object is inappropriate for this * List * @throws IllegalArgumentException * if the object cannot be added to this List */ @Override public boolean add(E object) { add(size(), object); return true; }
/** * Searches this list for the specified object and returns the index of the * last occurrence. * * @param object * the object to search for. * @return the index of the last occurrence of the object, or -1 if the * object was not found. */ public int lastIndexOf(Object object) { ListIterator<?> it = listIterator(size()); if (object != null) { while (it.hasPrevious()) { if (object.equals(it.previous())) { return it.nextIndex(); } } } else { while (it.hasPrevious()) { if (it.previous() == null) { return it.nextIndex(); } } } return -1; }
if (list.size() != size()) { return false;
/** * Extracts values from partition name without the column names. * @param name Partition name. * @param result The result. Must be pre-sized to the expected number of columns. */ public static AbstractList<String> makeValsFromName( String name, AbstractList<String> result) throws MetaException { assert name != null; String[] parts = slash.split(name, 0); if (result == null) { result = new ArrayList<>(parts.length); for (int i = 0; i < parts.length; ++i) { result.add(null); } } else if (parts.length != result.size()) { throw new MetaException( "Expected " + result.size() + " components, got " + parts.length + " (" + name + ")"); } for (int i = 0; i < parts.length; ++i) { int eq = parts[i].indexOf('='); if (eq <= 0) { throw new MetaException("Unexpected component " + parts[i]); } result.set(i, unescapePathName(parts[i].substring(eq + 1))); } return result; }
if (start >= 0 && end <= size()) { if (start <= end) { if (this instanceof RandomAccess) {
pruneReliableBlocks(dn, blocks); if (blocks.size() == 0) { if (!fullScan) { if (blocks.size() == 0 && isHealthy) { if (dn.isDecommissionInProgress()) { setDecommissioned(dn); + " It needs to replicate {} more blocks." + " {} is still in progress.", dn, isHealthy ? "is": "isn't", blocks.size(), dn.getAdminState()); dn, blocks.size(), dn.getAdminState());
public int size() { return adapter.size(); } public NSArray<T> subList(int start, int end) {
public int size() { return listAdapter.size(); } public NSOrderedSet<T> subList(int start, int end) {
public int size() { return adapter.size(); } public NSArray<T> subList(int start, int end) {
public int size() { return listAdapter.size(); } public NSOrderedSet<T> subList(int start, int end) {
@Override public int getCount() { return items.size(); }
/** * Removes all elements from this list, leaving it empty. * * @throws UnsupportedOperationException * if removing from this list is not supported. * @see List#isEmpty * @see List#size */ @Override public void clear() { removeRange(0, size()); }
/** * Removes all elements from this list, leaving it empty. * * @throws UnsupportedOperationException * if removing from this list is not supported. * @see List#isEmpty * @see List#size */ @Override public void clear() { removeRange(0, size()); }
/** * Removes all elements from this list, leaving it empty. * * @throws UnsupportedOperationException * if removing from this list is not supported. * @see List#isEmpty * @see List#size */ @Override public void clear() { removeRange(0, size()); }
/** * Removes all elements from this list, leaving it empty. * * @throws UnsupportedOperationException * if removing from this list is not supported. * @see List#isEmpty * @see List#size */ @Override public void clear() { removeRange(0, size()); }
private void rangeCheckForAdd(int index) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException(outOfBoundsMsg(index)); }
/** * Removes all elements from this list, leaving it empty. * * @throws UnsupportedOperationException * if removing from this list is not supported. * @see List#isEmpty * @see List#size */ @Override public void clear() { removeRange(0, size()); }