Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

IQueue.Offer Method

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.

[Visual Basic]
Public Sub Offer( _
   ByVal objectToAdd As Object _
)
[C#]
bool Offer(
   object objectToAdd
);

Parameters

objectToAdd
The element to add.

Return Value

if the element was added to this queue.

Remarks

When using a capacity-restricted queue, this method is generally preferable to Add, which can fail to insert an element only by throwing an exception.

Exceptions

Exception Type Condition
InvalidOperationException If the element cannot be added at this time due to capacity restrictions.
ArgumentNullException If the supplied objectToAdd is .
ArgumentException If some property of the supplied objectToAdd prevents it from being added to this queue.

See Also

IQueue Interface | Spring.Collections Namespace