Show / Hide Table of Contents

Class SimpleElement.SimpleElementAttributes

An IDictionary implementation using a ListDictionary that supports only strings for keys and IXmlValue for values.

Inheritance
object
SimpleElement.SimpleElementAttributes
Implements
IDictionary
ICollection
IEnumerable
ICloneable
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Tangosol.Run.Xml
Assembly: Coherence.dll
Syntax
protected class SimpleElement.SimpleElementAttributes : IDictionary, ICollection, IEnumerable, ICloneable

Constructors

SimpleElementAttributes(SimpleElement)

Create new SimpleElementAttributes instance with specified parent.

Declaration
public SimpleElementAttributes(SimpleElement parent)
Parameters
Type Name Description
SimpleElement parent

Parent SimpleElement.

Properties

Count

Gets the number of elements contained in the collection.

Declaration
public virtual int Count { get; }
Property Value
Type Description
int

The number of elements contained in the collection.

IsFixedSize

Gets a value indicating whether the dictionary object has a fixed size.

Declaration
public virtual bool IsFixedSize { get; }
Property Value
Type Description
bool

true if the dictionary object has a fixed size; otherwise, false.

IsReadOnly

Gets a value indicating whether the dictionary is read-only.

Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type Description
bool

true if the dictionary is read-only; otherwise, false.

IsSynchronized

Gets a value indicating whether access to the collection is synchronized (thread safe).

Declaration
public virtual bool IsSynchronized { get; }
Property Value
Type Description
bool

true if access to the collection is synchronized (thread safe); otherwise, false.

this[object]

Gets or sets the element with the specified key.

Declaration
public virtual object this[object key] { get; set; }
Parameters
Type Name Description
object key

The key of the element to get or set.

Property Value
Type Description
object

The element with the specified key.

Exceptions
Type Condition
ArgumentNullException

Key is null.

ArgumentException

Key is not string, or it is not a valid attribute name, or value is not IXmlValue.

InvalidOperationException

Parent SimpleElement is not mutable.

Keys

Gets an ICollection object containing the keys of the dictionary.

Declaration
public virtual ICollection Keys { get; }
Property Value
Type Description
ICollection

An ICollection containing the keys of the dictionary.

SyncRoot

Gets an object that can be used to synchronize access to the collection.

Declaration
public virtual object SyncRoot { get; }
Property Value
Type Description
object

An object that can be used to synchronize access to the collection.

Values

Gets an ICollection object containing the values of the dictionary.

Declaration
public virtual ICollection Values { get; }
Property Value
Type Description
ICollection

An ICollection containing the values of the dictionary.

Methods

Add(object, object)

Adds an element with the provided key and value to the dictionary.

Declaration
public virtual void Add(object key, object value)
Parameters
Type Name Description
object key

The object to use as the key of the element to add.

object value

The object to use as the value of the element to add.

Exceptions
Type Condition
ArgumentException

An element with the same key already exists in the dictionary.

ArgumentNullException

Key is null.

ArgumentException

Key is not string, or it is not a valid attribute name, or value is not IXmlValue.

InvalidOperationException

Parent SimpleElement is not mutable.

CheckKey(object)

Validates that specified key is string and is valid attribute name (IsNameValid(string).

Declaration
protected virtual void CheckKey(object key)
Parameters
Type Name Description
object key

Key to be validated.

Exceptions
Type Condition
ArgumentException

Key is not string or is not valid name.

CheckMutable()

Validates that the parent element is mutable, otherwise throws an InvalidOperationException.

Declaration
protected virtual void CheckMutable()
Exceptions
Type Condition
InvalidOperationException

CheckValue(object)

Validates that the valus is IXmlValue.

Declaration
protected virtual IXmlValue CheckValue(object value)
Parameters
Type Name Description
object value

Value to be validated.

Returns
Type Description
IXmlValue

IXmlValue whose parent is set to this attributes parent.

Clear()

Removes all elements from the dictionary.

Declaration
public virtual void Clear()
Exceptions
Type Condition
InvalidOperationException

Parent SimpleElement is not mutable.

Clone()

Creates and returns a copy of this dictionary.

Declaration
public virtual object Clone()
Returns
Type Description
object

A clone of this instance.

Contains(object)

Determines whether this dictionary contains an element with the specified key.

Declaration
public virtual bool Contains(object key)
Parameters
Type Name Description
object key

The key to locate in the dictionary.

Returns
Type Description
bool

true if the dictionary contains an element with the key; otherwise, false.

Exceptions
Type Condition
ArgumentNullException

Key is null.

CopyTo(Array, int)

Copies the elements of the ICollection to an Array, starting at a particular array index.

Declaration
public virtual void CopyTo(Array array, int index)
Parameters
Type Name Description
Array array

The one-dimensional array that is the destination of the elements copied from ICollection. The array must have zero-based indexing.

int index

The zero-based index in array at which copying begins.

Exceptions
Type Condition
ArgumentNullException

Array is null.

ArgumentOutOfRangeException

Index is less than zero.

ArgumentException

Array is multidimensional or index is equal to or greater than the length of array or the number of elements in the source collection is greater than the available space from index to the end of the destination array.

InvalidCastException

The type of the source collection cannot be cast automatically to the type of the destination array.

Equals(object)

Compare this dictionary with another for equality.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The object to compare to.

Returns
Type Description
bool

true if the dictionaries are equal, false otherwise.

Overrides
object.Equals(object)

GetEnumerator()

Returns an enumerator that iterates through a collection.

Declaration
public virtual IEnumerator GetEnumerator()
Returns
Type Description
IEnumerator

An IEnumerator object that can be used to iterate through the collection.

GetHashCode()

Provide a hash value for this SimpleElementAttributes.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()

Remove(object)

Removes the element with the specified key from the dictionary.

Declaration
public virtual void Remove(object key)
Parameters
Type Name Description
object key

The key of the element to remove.

Exceptions
Type Condition
ArgumentNullException

Key is null.

InvalidOperationException

Parent SimpleElement is not mutable.

Implements

IDictionary
ICollection
IEnumerable
ICloneable
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.