Skip to content

Commit 77a444b

Browse files
authored
Update $.java
1 parent 23ac1f3 commit 77a444b

File tree

1 file changed

+5
-1
lines changed
  • src/main/java/com/github/underscore

1 file changed

+5
-1
lines changed

src/main/java/com/github/underscore/$.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,18 @@ private static final class MyIterable<T> implements Iterable<T> {
135135
private boolean firstRun = true;
136136
private T value;
137137

138-
public MyIterable(final T seed, final UnaryOperator<T> unaryOperator) {
138+
MyIterable(final T seed, final UnaryOperator<T> unaryOperator) {
139139
this.value = seed;
140140
this.unaryOperator = unaryOperator;
141141
}
142142

143143
public Iterator<T> iterator() {
144144
return new Iterator<T>() {
145+
@Override
145146
public boolean hasNext() {
146147
return true;
147148
}
149+
@Override
148150
public T next() {
149151
if (firstRun) {
150152
firstRun = false;
@@ -153,7 +155,9 @@ public T next() {
153155
}
154156
return value;
155157
}
158+
@Override
156159
public void remove() {
160+
throw new UnsupportedOperationException("Remove is not supported");
157161
}
158162
};
159163
}

0 commit comments

Comments
 (0)