Sets up the index table based on the given list of the same size and
comparator.

@param <T> the type in use
@param list the list of points to obtain a sorted IndexTable for
@param cmp the comparator to determined the sorted order
10872
public <T> void sort(List<T> list, Comparator<T> cmp)
    {
        if(index.size() < list.size())
            for(int i = index.size(); i < list.size(); i++ )
                index.add(i);
        if(list.size() == index.size())
            Collections.sort(index, new IndexViewCompList(list, cmp));
        else
        {
            Collections.sort(index);//so [0, list.size) is at the front
            Collections.sort(index.subList(0, list.size()), new IndexViewCompList(list, cmp));
        }
        prevSize = list.size();
    }
896643
public void sortByEigenValue(Comparator<Double> cmp)
    {
        if(isComplex())
            throw new ArithmeticException("Eigen values can not be sorted due to complex results");
        IndexTable it = new IndexTable(DoubleList.unmodifiableView(d, d.length), cmp);
        
        for(int i = 0; i < d.length; i++)
        {
            RowColumnOps.swapCol(V, i, it.index(i));
            double tmp = d[i];
            d[i] = d[it.index(i)];
            d[it.index(i)] = tmp;
            
            it.swap(i, it.index(i));
        }
        
    }
89542
public static <T extends Comparable<? super T>> void sort(List<T> list) {
		if (useQuickSort) QuickSort.sort(list);
		else              Collections.sort(list);
	}
55840
public void setData(TFloatList list) {
        this.buffer = CausticUtil.createByteBuffer(list.size() * DataType.FLOAT.getByteSize());
        final TFloatIterator iterator = list.iterator();
        while (iterator.hasNext()) {
            buffer.putFloat(iterator.next());
        }
    }
1317073
public void setClusterInfoList(java.util.Collection<ClusterInfo> clusterInfoList) {
        if (clusterInfoList == null) {
            this.clusterInfoList = null;
            return;
        }

        this.clusterInfoList = new java.util.ArrayList<ClusterInfo>(clusterInfoList);
    }
439516
public void setAZList(java.util.Collection<String> aZList) {
        if (aZList == null) {
            this.aZList = null;
            return;
        }

        this.aZList = new com.amazonaws.internal.SdkInternalList<String>(aZList);
    }
721179
private void setListSelection(int selectedIndex) {
        if (selectedIndex == -1) {
            list.clearSelection();
        } else {
            list.setSelectedIndex(selectedIndex);
            list.ensureIndexIsVisible(selectedIndex);
        }
    }
395723
public void pollAllToList(List<T> retList) {
    while (head != null) {
      retList.add(head.element);
      head = head.after;
    }
    this.clear();
  }
1345532
public void setTableColumnNames(HashMappedList list) {

        if (resultTable != null) {
            ((TableDerived) resultTable).columnList = list;

            return;
        }

        leftQueryExpression.setTableColumnNames(list);
    }
352908
public void setData(TDoubleList list) {
        this.buffer = CausticUtil.createByteBuffer(list.size() * DataType.DOUBLE.getByteSize());
        final TDoubleIterator iterator = list.iterator();
        while (iterator.hasNext()) {
            buffer.putDouble(iterator.next());
        }
    }
591934
public static <T extends Comparable<T>> void bucketSort(final List<T> c) {
        Array.bucketSort(c);
    }
906373
public void sort(Comparator<T> sort) {
		ArrayList<T> tmp = new ArrayList<T>();
		
        for( Collection<T> page : pages ) {
			tmp.addAll(page);
		}
		setup(tmp, pageSize, sort);
	}
1041087
public void setIdxlist(List<int[]> idxs) {
			Iterator<int[]> iter = idxs.iterator();
			while (iter.hasNext()){
				int[] e = iter.next();
				idxlist.add(e);
			}
		}
862561
public void setPartitionInputList(java.util.Collection<PartitionInput> partitionInputList) {
        if (partitionInputList == null) {
            this.partitionInputList = null;
            return;
        }

        this.partitionInputList = new java.util.ArrayList<PartitionInput>(partitionInputList);
    }
254128
public void setTable(final Table table) {
        if (table != _tableRef.get()) {
            _tableRef.set(table);

            if (table == null) {
                _comboBox.setEmptyModel();
            } else {
                _comboBox.setModel(table);
            }
        }
    }
279973
public void setSAMLProviderList(java.util.Collection<SAMLProviderListEntry> sAMLProviderList) {
        if (sAMLProviderList == null) {
            this.sAMLProviderList = null;
            return;
        }

        this.sAMLProviderList = new com.amazonaws.internal.SdkInternalList<SAMLProviderListEntry>(sAMLProviderList);
    }
546622
public static <T extends Comparable<? super T>> ArrayList<T> sortThis(ArrayList<T> list)
    {
        return ArrayListIterate.sortThis(list, Comparators.naturalOrder());
    }