diff options
Diffstat (limited to 'src/ch/epfl/xblast/Lists.java')
-rw-r--r-- | src/ch/epfl/xblast/Lists.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ch/epfl/xblast/Lists.java b/src/ch/epfl/xblast/Lists.java index 096ceba..aadc694 100644 --- a/src/ch/epfl/xblast/Lists.java +++ b/src/ch/epfl/xblast/Lists.java | |||
@@ -1,20 +1,21 @@ | |||
1 | package ch.epfl.xblast; | 1 | package ch.epfl.xblast; |
2 | 2 | ||
3 | import java.util.List; | ||
4 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
5 | import java.util.Collections; | 4 | import java.util.Collections; |
5 | import java.util.List; | ||
6 | 6 | ||
7 | /** | 7 | /** |
8 | * @author Pacien TRAN-GIRARD (261948) | 8 | * @author Pacien TRAN-GIRARD (261948) |
9 | * @author Timothée FLOURE (257420) | 9 | * @author Timothée FLOURE (257420) |
10 | */ | 10 | */ |
11 | public final class Lists { | 11 | public final class Lists { |
12 | |||
12 | /** | 13 | /** |
13 | * Return a sysmetric version of the list. | 14 | * Return a sysmetric version of the list. |
14 | * | 15 | * |
15 | * @param l the input list | 16 | * @param l the input list |
16 | * @throws IllegalArgumentException if the given list is empty | ||
17 | * @return mirroredList the mirrored ilist | 17 | * @return mirroredList the mirrored ilist |
18 | * @throws IllegalArgumentException if the given list is empty | ||
18 | */ | 19 | */ |
19 | public static <T> List<T> mirrored(List<T> l) { | 20 | public static <T> List<T> mirrored(List<T> l) { |
20 | if (l.size() == 0) { | 21 | if (l.size() == 0) { |
@@ -24,7 +25,7 @@ public final class Lists { | |||
24 | List<T> mirroredList = new ArrayList<T>(); | 25 | List<T> mirroredList = new ArrayList<T>(); |
25 | List<T> rightSide = new ArrayList<T>(); | 26 | List<T> rightSide = new ArrayList<T>(); |
26 | 27 | ||
27 | for (int i=0;i < l.size()-1;i++) { | 28 | for (int i = 0; i < l.size() - 1; i++) { |
28 | rightSide.add(l.get(i)); | 29 | rightSide.add(l.get(i)); |
29 | } | 30 | } |
30 | 31 | ||
@@ -35,4 +36,5 @@ public final class Lists { | |||
35 | 36 | ||
36 | return mirroredList; | 37 | return mirroredList; |
37 | } | 38 | } |
39 | |||
38 | } | 40 | } |