Пример #1
0
        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;
        }
Пример #2
0
        // *** IEquatable<IdxDat<T>> interface implementation ***

        public bool Equals(IdxDat <T> other)
        {
            return(other.m_idx == m_idx);
        }
Пример #3
0
        // *** IComparable<IdxDat<T>> interface implementation ***

        public int CompareTo(IdxDat <T> other)
        {
            return(m_idx.CompareTo(other.Idx));
        }