Skip to content

Commit e1990ea

Browse files
committed
Code cleanup.
1 parent 7dafefa commit e1990ea

28 files changed

+142
-241
lines changed

src/main/java/org/javimmutable/collections/Func0.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
*
4141
* @param <T>
4242
*/
43+
@FunctionalInterface
4344
public interface Func0<T>
4445
{
4546
T apply();

src/main/java/org/javimmutable/collections/Func1.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
/**
4141
* Interface for functions that take a single parameter.
4242
*/
43+
@FunctionalInterface
4344
public interface Func1<P, R>
4445
extends Function<P, R>
4546
{

src/main/java/org/javimmutable/collections/Func2.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
/**
3939
* Interface for functions that take two parameters.
4040
*/
41+
@FunctionalInterface
4142
public interface Func2<P1, P2, R>
4243
{
4344
R apply(P1 p1,

src/main/java/org/javimmutable/collections/Func3.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
/**
3939
* Interface for functions that take three parameters.
4040
*/
41+
@FunctionalInterface
4142
public interface Func3<P1, P2, P3, R>
4243
{
4344
R apply(P1 p1,

src/main/java/org/javimmutable/collections/Func4.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
/**
3939
* Interface for functions that take four parameters.
4040
*/
41+
@FunctionalInterface
4142
public interface Func4<P1, P2, P3, P4, R>
4243
{
4344
R apply(P1 p1,

src/main/java/org/javimmutable/collections/Indexed.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,18 @@
3737

3838
/**
3939
* Interface for containers that allow access to values by an integer index.
40-
*
41-
* @param <T>
4240
*/
4341
public interface Indexed<T>
4442
{
4543
/**
4644
* Retrieve the value. The index must be valid for the container's current size (i.e. [0-size)
4745
*
48-
* @param index
49-
* @return
5046
* @throws IndexOutOfBoundsException if index is out of bounds
5147
*/
5248
T get(int index);
5349

5450
/**
5551
* Retrieve the number of values available in the container.
56-
*
57-
* @return
5852
*/
5953
int size();
6054
}

src/main/java/org/javimmutable/collections/JImmutableArray.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public interface JImmutableArray<T>
6767
* @return value associated with index or null if no value is associated
6868
*/
6969
@Nullable
70+
@Override
7071
T get(int index);
7172

7273

@@ -130,6 +131,7 @@ JImmutableArray<T> assign(int index,
130131
/**
131132
* Return the number of entries in the map.
132133
*/
134+
@Override
133135
int size();
134136

135137
/**

src/main/java/org/javimmutable/collections/JImmutableList.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ interface Builder<T>
7272
*
7373
* @throws IndexOutOfBoundsException if index is out of bounds
7474
*/
75+
@Override
7576
T get(int index);
7677

7778
/**
@@ -88,6 +89,7 @@ JImmutableList<T> assign(int index,
8889
* Adds a value to the end of the list. May be invoked on an empty list.
8990
*/
9091
@Nonnull
92+
@Override
9193
JImmutableList<T> insert(@Nullable T value);
9294

9395
/**
@@ -144,7 +146,7 @@ JImmutableList<T> assign(int index,
144146
*/
145147
@Nonnull
146148
JImmutableList<T> insertAllFirst(@Nonnull Iterable<? extends T> values);
147-
149+
148150
/**
149151
* Adds the values to the beginning of the list in the same order they appear in the Iterable. May be invoked on an empty list.
150152
*
@@ -169,7 +171,7 @@ JImmutableList<T> assign(int index,
169171
*/
170172
@Nonnull
171173
JImmutableList<T> insertAllLast(@Nonnull Iterable<? extends T> values);
172-
174+
173175
/**
174176
* Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
175177
* Synonym for insertAll()

src/main/java/org/javimmutable/collections/JImmutableMap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ interface Entry<K, V>
8181
* @return empty Holder if not found, otherwise filled Holder with value
8282
*/
8383
@Nonnull
84+
@Override
8485
Holder<V> find(@Nonnull K key);
8586

8687
/**

src/main/java/org/javimmutable/collections/JImmutableMultiset.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ JImmutableMultiset<T> deleteOccurrence(@Nonnull T value,
482482
* @return Cursor that behaves as if multiset was a JImmutableSet
483483
*/
484484
@Nonnull
485+
@Override
485486
Cursor<T> cursor();
486487

487488
/**
@@ -533,11 +534,13 @@ JImmutableMultiset<T> setCount(@Nonnull T value,
533534
/**
534535
* @return true only if the multiset contains no values
535536
*/
537+
@Override
536538
boolean isEmpty();
537539

538540
/**
539541
* @return total number of unique values in the multiset. Same as the number of items in cursor() and entryCursor().
540542
*/
543+
@Override
541544
int size();
542545

543546
/**

0 commit comments

Comments
 (0)