< prev index next > test/jdk/java/util/Spliterator/SpliteratorLateBindingFailFastHelper.java
Print this page
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
() -> new MapSource<>(m -> m.entrySet(), e.getValue()));
}
}
}
- static class AbstractRandomAccessListImpl extends AbstractList<Integer> implements RandomAccess {
- List<Integer> l;
+ static class AbstractRandomAccessListImpl<T> extends AbstractList<T> implements RandomAccess {
+ List<T> l;
- AbstractRandomAccessListImpl(Collection<Integer> c) {
+ AbstractRandomAccessListImpl(Collection<T> c) {
this.l = new ArrayList<>(c);
}
@Override
- public boolean add(Integer integer) {
+ public boolean add(T value) {
modCount++;
- return l.add(integer);
+ return l.add(value);
}
@Override
- public Iterator<Integer> iterator() {
+ public Iterator<T> iterator() {
return l.iterator();
}
@Override
- public Integer get(int index) {
+ public T get(int index) {
return l.get(index);
}
@Override
public boolean remove(Object o) {
public int size() {
return l.size();
}
@Override
- public List<Integer> subList(int fromIndex, int toIndex) {
+ public List<T> subList(int fromIndex, int toIndex) {
return l.subList(fromIndex, toIndex);
}
}
}
< prev index next >