/// <summary> /// Removes the first occurrence of a specific item from the list /// </summary> /// <param name="value">Item</param> void IList.Remove(object value) { if (CircularList <T> .IsCompatibleObject(value)) { this.Remove((T)((object)value)); } }
/// <summary> /// Enumerator constructor /// </summary> /// <param name="srcList">Source CircularList to enumerate</param> internal Enumerator(CircularList <T> srcList) { Contract.Requires(srcList != null); _srcList = srcList; _version = _srcList._version; _index = -1; _currentElement = default(T); }
/// <summary> /// Searches for the specified 'item' and returns the index of the first occurrence of the item inside list /// </summary> /// <param name="value">The item to locate inside the list</param> /// <returns>The index of element inside the list, if found. -1 otherwise</returns> int IList.IndexOf(object value) { if (CircularList <T> .IsCompatibleObject(value)) { return(this.IndexOf((T)((object)value))); } return(-1); }
/// <summary> /// OutOfTurnQueue constructor /// </summary> /// <param name="collection">The collection whose elements are copied to the new queue</param> public OutOfTurnQueue(IEnumerable <T> collection) { if (collection == null) { throw new ArgumentNullException(nameof(collection)); } _circularList = new CircularList <T>(collection); }
/// <summary> /// OutOfTurnQueue constructor /// </summary> /// <param name="capacity">Initial capacity</param> public OutOfTurnQueue(int capacity) { if (capacity < 0) { throw new ArgumentOutOfRangeException(nameof(capacity), "capacity cannot be negative"); } _circularList = new CircularList <T>(capacity); }
/// <summary> /// Enumerator constructor /// </summary> /// <param name="srcList">Source CircularList to enumerate</param> internal Enumerator(CircularList <T> srcList) { TurboContract.Requires(srcList != null, conditionString: "srcList != null"); _srcList = srcList; _version = _srcList._version; _index = -1; _currentElement = default(T); }
/// <summary> /// OutOfTurnQueue constructor /// </summary> public OutOfTurnQueue() { _circularList = new CircularList <T>(); }
/// <summary> /// Deque constructor /// </summary> /// <param name="collection">The collection whose elements are copied to the new deque</param> public Deque(IEnumerable <T> collection) { Contract.Requires <ArgumentNullException>(collection != null); _circularList = new CircularList <T>(collection); }
/// <summary> /// Deque constructor with specified initial capacity /// </summary> /// <param name="capacity">Initial capacity</param> public Deque(int capacity) { Contract.Requires <ArgumentOutOfRangeException>(capacity >= 0); _circularList = new CircularList <T>(capacity); }
/// <summary> /// Deque constructor /// </summary> public Deque() { _circularList = new CircularList <T>(); }
/// <summary> /// Determines whether an element is in the List /// </summary> /// <param name="value">The object to locate in the List</param> /// <returns>True if item is found</returns> bool IList.Contains(object value) { return(CircularList <T> .IsCompatibleObject(value) && this.Contains((T)((object)value))); }
/// <summary> /// OutOfTurnQueue constructor /// </summary> /// <param name="capacity">Initial capacity</param> public OutOfTurnQueue(int capacity) { Contract.Requires <ArgumentException>(capacity >= 0); _circularList = new CircularList <T>(capacity); }