19 package ca.uqac.lif.synthia.collection;
21 import java.util.ArrayList;
22 import java.util.List;
31 public class ComparableList<T>
extends ArrayList<T> implements Comparable<List<T>>
36 private static final long serialVersionUID = 1L;
66 @SuppressWarnings(
"unchecked")
69 if (this.size() < o.size())
73 else if (this.size() > o.size())
82 while ((i < this.size()) && (answer == 0))
85 if (((this.
get(i)) instanceof Comparable) && ((o.get(i)) instanceof Comparable))
89 answer = ((Comparable<T>) this.
get(i)).
compareTo(o.get(i));
91 catch (ClassCastException exception)
96 else if (((this.
get(i)) instanceof List) && ((o.get(i)) instanceof List))