fixed warnings
This commit is contained in:
parent
93b14283c2
commit
528804863f
3 changed files with 3 additions and 5 deletions
|
|
@ -2,6 +2,7 @@ package zutil.algo.sort.sortable;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public class SortableArrayList<T> implements SortableDataList<T>{
|
||||
private ArrayList<T> list;
|
||||
|
||||
|
|
@ -27,14 +28,12 @@ public class SortableArrayList<T> implements SortableDataList<T>{
|
|||
list.set(b, temp);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public int compare(int a, int b) {
|
||||
Comparable aa = (Comparable)list.get(a);
|
||||
Comparable bb = (Comparable)list.get(b);
|
||||
return aa.compareTo(bb);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public int compare(int a, T b) {
|
||||
Comparable aa = (Comparable)list.get(a);
|
||||
Comparable bb = (Comparable)b;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package zutil.algo.sort.sortable;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public class SortableComparableArray implements SortableDataList<Comparable>{
|
||||
private Comparable[] list;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package zutil.algo.sort.sortable;
|
|||
|
||||
import java.util.LinkedList;
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public class SortableLinkedList<T> implements SortableDataList<T>{
|
||||
private LinkedList<T> list;
|
||||
|
||||
|
|
@ -27,14 +28,12 @@ public class SortableLinkedList<T> implements SortableDataList<T>{
|
|||
list.set(b, temp);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public int compare(int a, int b) {
|
||||
Comparable aa = (Comparable)list.get(a);
|
||||
Comparable bb = (Comparable)list.get(b);
|
||||
return aa.compareTo(bb);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public int compare(int a, T b) {
|
||||
Comparable aa = (Comparable)list.get(a);
|
||||
Comparable bb = (Comparable)b;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue