Click or drag to resize

CollectionUtilsAdd Method (ICollection, Object, Boolean)

Oracle® Fusion Middleware .NET API Reference for Oracle Coherence
14c (14.1.1.0)
F23534-02
Adds a new element to the specified collection.

Namespace:  Tangosol.Util
Assembly:  Coherence (in Coherence.dll) Version: 14.1.1.14 (14.1.1.14)
Syntax
C#
public static bool Add(
	ICollection target,
	Object obj,
	bool isUnique
)

Parameters

target
Type: System.CollectionsICollection
Collection where the new element will be added.
obj
Type: SystemObject
Object to add.
isUnique
Type: SystemBoolean
true if the value should be unique in the target collection; false otherwise.

Return Value

Type: Boolean
true if the element was added, false otherwise.
Exceptions
ExceptionCondition
NotSupportedException If target is a fixed-size collection, or if its type is an unknown collection type.
Remarks
This method allows us to add element to any collection type from the System.Collections namespace in a uniform manner, thus hiding differences in the API between IList implementations and classes such as Queue and Stack. When collection is IDictionary object should be DictionaryEntry.
See Also