Exemplo n.º 1
0
            /// <summary>
            /// Creates a copy of the TreeSetSupport.
            /// </summary>
            /// <returns>A copy of the TreeSetSupport.</returns>
            public virtual object TreeSetClone()
            {
                TreeSetSupport internalClone = new TreeSetSupport();

                internalClone.AddAll(this);
                return(internalClone);
            }
Exemplo n.º 2
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 SortedSetSupport TailSet(System.Object limit)
 {
     SortedSetSupport newList = new TreeSetSupport();
     int i = 0;
     while (this.comparator.Compare(this[i], limit) < 0)
         i++;
     for (; i < this.Count; i++)
         newList.Add(this[i]);
     return newList;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns a portion of the list whose elements are greater that the lowerLimit parameter less than the upperLimit parameter.
 /// </summary>
 /// <param name="lowerLimit">The start element of the portion to extract.</param>
 /// <param name="upperLimit">The end element of the portion to extract.</param>
 /// <returns>The portion of the collection.</returns>
 public SortedSetSupport SubSet(System.Object lowerLimit, System.Object upperLimit)
 {
     SortedSetSupport newList = new TreeSetSupport();
     int i = 0;
     while (this.comparator.Compare(this[i], lowerLimit) < 0)
         i++;
     for (; i < this.Count; i++)
     {
         if (this.comparator.Compare(this[i], upperLimit) >= 0)
             break;
         newList.Add(this[i]);
     }
     return newList;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns a portion of the list whose elements are less than the limit object parameter.
 /// </summary>
 /// <param name="limit">The end element of the portion to extract.</param>
 /// <returns>The portion of the collection whose elements are less than the limit object parameter.</returns>
 public SortedSetSupport HeadSet(System.Object limit)
 {
     SortedSetSupport newList = new TreeSetSupport();
     for (int i = 0; i < this.Count; i++)
     {
         if (this.comparator.Compare(this[i], limit) >= 0)
             break;
         newList.Add(this[i]);
     }
     return newList;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a copy of the TreeSetSupport.
 /// </summary>
 /// <returns>A copy of the TreeSetSupport.</returns>
 public virtual object TreeSetClone()
 {
     TreeSetSupport internalClone = new TreeSetSupport();
     internalClone.AddAll(this);
     return internalClone;
 }