SynchronizedStack
Represents a synchronized stack of items.
Hereda de: SynchronizedCollection<T, StackEx<T>>
Constructores
public SynchronizedStack()
synchronizedStack = SynchronizedStack()
Initializes a new instance of the SynchronizedStack class.
Métodos
public override void Insert(int index, T item)
synchronizedStack.Insert(index, item)
Throws a NotSupportedException as this operation is not supported for a stack.
- index
- The index at which the item should be inserted.
- item
- The item to insert.
protected override T OnGetItem(int index)
result = synchronizedStack.OnGetItem(index)
Throws a NotSupportedException as this operation is not supported for a stack.
- index
- The index of the item to retrieve.
Devuelve: This method always throws an exception.
protected override int OnIndexOf(T item)
result = synchronizedStack.OnIndexOf(item)
Throws a NotSupportedException as this operation is not supported for a stack.
- item
- The item to locate in the stack.
Devuelve: This method always throws an exception.
protected override void OnInsert(int index, T item)
synchronizedStack.OnInsert(index, item)
Throws a NotSupportedException as this operation is not supported for a stack.
- index
- The index at which the item should be inserted.
- item
- The item to insert.
protected override void OnRemoveAt(int index)
synchronizedStack.OnRemoveAt(index)
Throws a NotSupportedException as this operation is not supported for a stack.
- index
- The index of the item to remove.
public T Peek()
result = synchronizedStack.Peek()
Returns the object at the top of this stack without removing it.
Devuelve: The item at the top.
public T Pop()
result = synchronizedStack.Pop()
Removes and returns the object at the top of this stack.
Devuelve: The item removed from the top.
public void Push(T item)
synchronizedStack.Push(item)
Adds an item to the top of this stack.
- item
- The item to add.