Add() public method

Adds a new element to the ArrayList if it is not already present and sorts the ArrayList.
public Add ( object obj ) : bool
obj object Element to insert to the ArrayList.
return bool
Beispiel #1
0
 /// <summary>
 /// Returns a portion of the list whose elements are greater than the limit object parameter.
 /// </summary>
 /// <param name="limit">The start element of the portion to extract.</param>
 /// <returns>The portion of the collection whose elements are greater than the limit object parameter.</returns>
 public ISortedSet TailSet(object limit)
 {
     ISortedSet newList = new TreeSet();
     int i = 0;
     while ((i < Count) && (comparator.Compare(this[i], limit) < 0))
     {
         i++;
     }
     for (; i < Count; i++)
     {
         newList.Add(this[i]);
     }
     return newList;
 }