Changeset 69
- Timestamp:
- 03/17/08 10:22:09 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/ItemList_T.cs
r68 r69 47 47 protected void CloneElements(ItemList<T> destination, IDictionary<Guid, object> clonedObjects) { 48 48 for (int i = 0; i < list.Count; i++) 49 destination.list.Add((T) Auxiliary.Clone(list[i],clonedObjects));49 destination.list.Add((T) Auxiliary.Clone(list[i], clonedObjects)); 50 50 } 51 51 … … 140 140 141 141 #region List<T> Methods 142 public int LastIndexOf(T item) { 143 return list.LastIndexOf(item); 144 } 145 146 public int LastIndexOf(T item, int index) { 147 return list.LastIndexOf(item, index); 148 } 149 150 public int LastIndexOf(T item, int index, int count) { 151 return list.LastIndexOf(item, index, count); 152 } 153 154 public int IndexOf(T item, int index) { 155 return list.IndexOf(item, index); 156 } 157 158 public int IndexOf(T item, int index, int count) { 159 return list.IndexOf(item, index, count); 160 } 161 142 162 public void AddRange(IEnumerable<T> collection) { 143 163 foreach (T obj in collection) { … … 150 170 } 151 171 172 public int BinarySearch(T item) { 173 return list.BinarySearch(item); 174 } 175 176 public int BinarySearch(T item, IComparer<T> comparer) { 177 return list.BinarySearch(item, comparer); 178 } 179 180 public int BinarySearch(int index, int count, T item, IComparer<T> comparer) { 181 return list.BinarySearch(index, count, item, comparer); 182 } 183 152 184 public T Find(Predicate<T> match) { 153 185 return list.Find(match); … … 159 191 160 192 public int FindIndex(Predicate<T> match) { 161 return list.FindIndex(match); 193 return list.FindIndex(match); 194 } 195 196 public T FindLast(Predicate<T> match) { 197 return list.FindLast(match); 198 } 199 200 public int FindLastIndex(Predicate<T> match) { 201 return list.FindLastIndex(match); 162 202 } 163 203 164 204 public void Sort() { 165 list.Sort(); 205 list.Sort(); 166 206 } 167 207 168 208 public void Sort(IComparer<T> comparer) { 169 list.Sort(comparer); 209 list.Sort(comparer); 170 210 } 171 211 172 212 public void Sort(Comparison<T> comparison) { 173 list.Sort(comparison); 174 } 213 list.Sort(comparison); 214 } 175 215 176 216 public void Reverse() { 177 list.Reverse(); 178 } 217 list.Reverse(); 218 } 219 220 public ItemList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) where TOutput : IItem { 221 ItemList<TOutput> targetList = new ItemList<TOutput>(); 222 foreach (T item in list) { 223 targetList.Add(converter.Invoke(item)); 224 } 225 return targetList; 226 } 227 228 public bool TrueForAll(Predicate<T> match) { 229 return list.TrueForAll(match); 230 } 231 179 232 #endregion 180 233
Note: See TracChangeset
for help on using the changeset viewer.