(T e)
| 33 | } |
| 34 | |
| 35 | @Override |
| 36 | public boolean add(T e) |
| 37 | { |
| 38 | if(isEmpty()) |
| 39 | { |
| 40 | return super.add(e); |
| 41 | } |
| 42 | else |
| 43 | { |
| 44 | int ind = Collections.binarySearch(this, e); |
| 45 | if (ind < 0) |
| 46 | ind = -(ind + 1);//Now it is the point where it should be inserted |
| 47 | |
| 48 | if (ind > size()) |
| 49 | super.add(e); |
| 50 | else |
| 51 | super.add(ind, e); |
| 52 | return true; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | @Override |
| 57 | public void add(int index, T element) |