aboutsummaryrefslogtreecommitdiff
path: root/src/ch/epfl/xblast/Lists.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch/epfl/xblast/Lists.java')
-rw-r--r--src/ch/epfl/xblast/Lists.java8
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 @@
1package ch.epfl.xblast; 1package ch.epfl.xblast;
2 2
3import java.util.List;
4import java.util.ArrayList; 3import java.util.ArrayList;
5import java.util.Collections; 4import java.util.Collections;
5import 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 */
11public final class Lists { 11public 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}