| 1077 | } |
| 1078 | |
| 1079 | private static class UnmodifiableList<E> extends UnmodifiableCollection<E> |
| 1080 | implements List<E> { |
| 1081 | private static final long serialVersionUID = -283967356065247728L; |
| 1082 | |
| 1083 | final List<E> list; |
| 1084 | |
| 1085 | UnmodifiableList(List<E> l) { |
| 1086 | super(l); |
| 1087 | list = l; |
| 1088 | } |
| 1089 | |
| 1090 | public void add(int location, E object) { |
| 1091 | throw new UnsupportedOperationException(); |
| 1092 | } |
| 1093 | |
| 1094 | public boolean addAll(int location, Collection<? extends E> collection) { |
| 1095 | throw new UnsupportedOperationException(); |
| 1096 | } |
| 1097 | |
| 1098 | @Override |
| 1099 | public boolean equals(Object object) { |
| 1100 | return list.equals(object); |
| 1101 | } |
| 1102 | |
| 1103 | public E get(int location) { |
| 1104 | return list.get(location); |
| 1105 | } |
| 1106 | |
| 1107 | @Override |
| 1108 | public int hashCode() { |
| 1109 | return list.hashCode(); |
| 1110 | } |
| 1111 | |
| 1112 | public int indexOf(Object object) { |
| 1113 | return list.indexOf(object); |
| 1114 | } |
| 1115 | |
| 1116 | public int lastIndexOf(Object object) { |
| 1117 | return list.lastIndexOf(object); |
| 1118 | } |
| 1119 | |
| 1120 | public ListIterator<E> listIterator() { |
| 1121 | return listIterator(0); |
| 1122 | } |
| 1123 | |
| 1124 | public ListIterator<E> listIterator(final int location) { |
| 1125 | return new ListIterator<E>() { |
| 1126 | ListIterator<E> iterator = list.listIterator(location); |
| 1127 | |
| 1128 | public void add(E object) { |
| 1129 | throw new UnsupportedOperationException(); |
| 1130 | } |
| 1131 | |
| 1132 | public boolean hasNext() { |
| 1133 | return iterator.hasNext(); |
| 1134 | } |
| 1135 | |
| 1136 | public boolean hasPrevious() { |
nothing calls this directly
no outgoing calls
no test coverage detected