Ejemplo n.º 1
0
        public virtual void RemoveRange(int index, int toIndex)
        {
            int num = 0;

            Sharpen.Iterator iterator = this.Iterator();
            while (num <= index)
            {
                if (!iterator.HasNext())
                {
                    throw new IndexOutOfRangeException();
                }
                iterator.Next();
                num++;
            }
            if (index < toIndex)
            {
                iterator.Remove();
            }
            for (num = index + 1; num < toIndex; num++)
            {
                if (!iterator.HasNext())
                {
                    throw new IndexOutOfRangeException();
                }
                iterator.Next();
                iterator.Remove();
            }
        }
Ejemplo n.º 2
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(PropertyMaps.DEFAULT_NAME.Equals(GetName()) ? "<DEFAULT>" : GetName()).
            Append(" {");
            for (Sharpen.Iterator <PropertyMap.Property> iter = Iterator(); iter.HasNext();)
            {
                sb.Append(iter.Next());
                if (iter.HasNext())
                {
                    sb.Append(",");
                }
            }
            sb.Append("}");
            return(sb.ToString());
        }
Ejemplo n.º 3
0
 public virtual U Remove(object key)
 {
     Sharpen.Iterator <U> iterator = EntrySet() as Sharpen.Iterator <U>;
     if (iterator == null)
     {
         throw new NotSupportedException();
     }
     while (iterator.HasNext())
     {
         U local = iterator.Next();
         if (local.Equals((T)key))
         {
             iterator.Remove();
             return(local);
         }
     }
     return(default(U));
 }
Ejemplo n.º 4
0
        public virtual T Remove(int index)
        {
            if (index < 0)
            {
                throw new IndexOutOfRangeException();
            }
            int    num  = 0;
            object item = null;

            Sharpen.Iterator iterator = this.Iterator();
            while (num <= index)
            {
                if (!iterator.HasNext())
                {
                    throw new IndexOutOfRangeException();
                }
                item = iterator.Next();
                num++;
            }
            iterator.Remove();
            return((T)item);
        }