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(); } }
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()); }
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)); }
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); }