/** * {@inheritDoc} */ public S subList(int fromIndex, int toIndex) { return wrap(super.subList(fromIndex, toIndex)); }
public List subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
public List subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
@Override public List<K> subList(final int fromIndexInclusive, final int toIndexExclusive) { return UnmodifiableList.unmodifiableList(super.subList(fromIndexInclusive, toIndexExclusive)); } }
public List<K> subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
@Override public List<E> subList(int fromIndex, int toIndex) { if (fromIndex < 0 || toIndex > size || fromIndex > toIndex) { throw new IndexOutOfBoundsException("The indexes provided are outside the bounds of this list."); } return new SafeIteratorList<E>(super.subList(fromIndex, toIndex)); }
public List<Object> subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
/** * Returns a List of the specified portion of this vector from the start * index to one less than the end index. The returned List is backed by this * vector so changes to one are reflected by the other. * * @param start * the index at which to start the sublist. * @param end * the index one past the end of the sublist. * @return a List of a portion of this vector. * @throws IndexOutOfBoundsException * if {@code start < 0} or {@code end > size()}. * @throws IllegalArgumentException * if {@code start > end}. */ @Override public synchronized List<E> subList(int start, int end) { return new Collections.SynchronizedRandomAccessList<E>(super.subList( start, end), this); }
@Override public List<Object> subList(int fromIndex, int toIndex) { return super.subList(fromIndex, toIndex); }
@Override public List<Object> subList(int fromIndex, int toIndex) { return super.subList(fromIndex, toIndex); }
@Override public List<T> subList(int fromIndex, int toIndex) { final int sizeOfSublist = toIndex - fromIndex; if (sizeOfSublist > maxPages * (pageSize -1)) { // Increase the amount of cached pages if necessary maxPages = sizeOfSublist/pageSize + 1; } return new ArrayList<>(super.subList(fromIndex, toIndex)); }
Integer[] arr = {1,2,3,4,5}; LinkedList<Integer> ns = new LinkedList<Integer>(Arrays.asList(arr)); int rotate=3; if(rotate<0) rotate += arr.length; List<Integer> leftlist = ns.subList(0, rotate); List<Integer> rightlist = ns.subList(rotate, arr.length); LinkedList<Integer> result = new LinkedList<Integer>(); result.addAll(rightlist); result.addAll(leftlist); System.out.println(result);
import java.util.LinkedList; public class Test { public static void main(String[] args) { LinkedList<String> list = new LinkedList<String>(); list.add("x"); list.add("y"); list = (LinkedList<String>) list.subList(1, 2); } }
HashSet<Integer> h=new HashSet<>(); h.add(123); h.add(456); h.add(789); h.add(757); h.add(989); System.out.println((new LinkedList<T>(h)).subList(0, 2));
@JTranscAsync public List<E> subList(int fromIndex, int toIndex) { return super.subList(fromIndex, toIndex); } }
public List subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
public List subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
@Override public ExList<T> subList(int fromIndex, int toIndex) { return new ForwardingList<>(super.subList(fromIndex, toIndex)); }
public List subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
@Override public List<K> subList(final int fromIndexInclusive, final int toIndexExclusive) { return UnmodifiableList.unmodifiableList(super.subList(fromIndexInclusive, toIndexExclusive)); } }