MCPcopy Create free account
hub / github.com/davidgiven/luje / CheckedListIterator

Class CheckedListIterator

lib/java/util/Collections.java:2831–2911  ·  view source on GitHub ↗

Class represents a dynamically typesafe view of the specified ListIterator.

Source from the content-addressed store, hash-verified

2829 * ListIterator.
2830 */
2831 private static class CheckedListIterator<E> implements ListIterator<E> {
2832
2833 private ListIterator<E> i;
2834
2835 private Class<E> type;
2836
2837 /**
2838 * Constructs a dynamically typesafe view of the specified ListIterator.
2839 *
2840 * @param i -
2841 * the listIterator for which a dynamically typesafe view to
2842 * be constructed.
2843 */
2844 public CheckedListIterator(ListIterator<E> i, Class<E> type) {
2845 this.i = i;
2846 this.type = type;
2847 }
2848
2849 /**
2850 * @see java.util.Iterator#hasNext()
2851 */
2852 public boolean hasNext() {
2853 return i.hasNext();
2854 }
2855
2856 /**
2857 * @see java.util.Iterator#next()
2858 */
2859 public E next() {
2860 return i.next();
2861 }
2862
2863 /**
2864 * @see java.util.Iterator#remove()
2865 */
2866 public void remove() {
2867 i.remove();
2868 }
2869
2870 /**
2871 * @see java.util.ListIterator#hasPrevious()
2872 */
2873 public boolean hasPrevious() {
2874 return i.hasPrevious();
2875 }
2876
2877 /**
2878 * @see java.util.ListIterator#previous()
2879 */
2880 public E previous() {
2881 return i.previous();
2882 }
2883
2884 /**
2885 * @see java.util.ListIterator#nextIndex()
2886 */
2887 public int nextIndex() {
2888 return i.nextIndex();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected