List of utility methods to do List Resize
void | resize(List list, int newSize) resize if (newSize < list.size()) { list.subList(newSize, list.size()).clear(); } else { list.addAll(Collections.nCopies(newSize - list.size(), null)); |
void | resize(List> l, int n) resize if (l.size() > n) { while (l.size() > n) { l.remove(l.size() - 1); } else { while (l.size() < n) { l.add(null); |
void | resize(List resize if (list.size() <= newSize) { for (int i = 0; i < newSize - list.size(); i++) { list.add(newValue); } else { for (int i = list.size() - 1; i > newSize; i--) { list.remove(i); |
void | resize(List resize while (list.size() > size) list.remove(list.size() - 1); while (list.size() < size) list.add(null); |