public int indexOf(Comparable x) {
        if (this.autoSort) {
            return Collections.binarySearch(this.data, new ComparableObjectItem(
                    x, null));   
        }
        else {
            for (int i = 0; i < this.data.size(); i++) {
                ComparableObjectItem item = (ComparableObjectItem) 
                        this.data.get(i);
                if (item.getComparable().equals(x)) {
                    return i;   
                }
            }
            return -1;