public void Sort() { IdxDat <int>[] tmp = new IdxDat <int> [mIdx.Count]; for (int i = 0; i < mIdx.Count; i++) { tmp[i] = new IdxDat <int>(mIdx[i], i); } Array.Sort(tmp); ArrayList <T> newDat = new ArrayList <T>(mDat.Count); for (int i = 0; i < tmp.Length; i++) { mIdx[i] = tmp[i].Idx; newDat.Add(mDat[tmp[i].Dat]); } mDat = newDat; }
// *** IEquatable<IdxDat<T>> interface implementation *** public bool Equals(IdxDat <T> other) { return(other.m_idx == m_idx); }
// *** IComparable<IdxDat<T>> interface implementation *** public int CompareTo(IdxDat <T> other) { return(m_idx.CompareTo(other.Idx)); }