TZUnmodifiableCollection Class Reference

Implements an unmodifiable collection of interfaces. More...

Inheritance diagram for TZUnmodifiableCollection:

TZAbstractObject IZClonnable TInterfacedObject IZObject

List of all members.

Public Member Functions

Integer Add (const IZInterface Item)
 Adds a new object at the and of this collection.
Boolean AddAll (const IZCollection Col)
 Adds all elements from the specified collection into this collection.
 Clear ()
 Clears the content of this collection.
IZInterface Clone ()
 Clones the instance of this object.
Boolean Contains (const IZInterface Item)
 Checks is the specified object is stored in this collection.
Boolean ContainsAll (const IZCollection Col)
 Checks are all the object in this collection.
 Delete (Integer Index)
 Deletes an object from the specified position.
Boolean Equals (const IZInterface Value)
 Exchange (Integer Index1, Integer Index2)
 Exchanges two element in the collection.
IZInterface First ()
 Gets the first element from this collection.
IZInterface Get (Integer Index)
 Gets a collection element from the specified position.
Integer GetCount ()
 Gets a number of the stored element in this collection.
IZIterator GetIterator ()
 Gets a created iterator for this collection.
LongInt Hash ()
 Gets a unique hash for this object.
Integer IndexOf (const IZInterface Item)
 Defines an index of the specified object inside this colleciton.
 Insert (Integer Index, const IZInterface Item)
 Inserts an object into specified position.
Boolean InstanceOf (const TGUID IId)
 Checks is this object implements a specified interface.
IZInterface Last ()
 Gets the last object from this collection.
 Put (Integer Index, const IZInterface Item)
 Puts a specified object into defined position.
Integer Remove (const IZInterface Item)
 Removes an existed object which equals to the specified one.
Boolean RemoveAll (const IZCollection Col)
 Removes all the elements from the specified collection.
string ToString ()
 Gets a string representation for this object.
 TZUnmodifiableCollection (IZCollection Collection)
 Constructs this object and assignes main properties.
 ~TZUnmodifiableCollection ()
 Destroys this object and frees the memory.

Public Attributes

Integer Count
IZInterface Items

Private Member Functions

Boolean Equals (const IZInterface &Value)
 RaiseException ()
 Raises invalid operation exception.

Private Attributes

IZCollection FCollection


Detailed Description

Implements an unmodifiable collection of interfaces.

Definition at line 219 of file ZCollections.pas.


Constructor & Destructor Documentation

TZUnmodifiableCollection::TZUnmodifiableCollection ( IZCollection  Collection  ) 

Constructs this object and assignes main properties.

Parameters:
Collection an initial modifiable list of interfaces.

Definition at line 1016 of file ZCollections.pas.

TZUnmodifiableCollection::~TZUnmodifiableCollection (  ) 

Destroys this object and frees the memory.

Definition at line 1029 of file ZCollections.pas.


Member Function Documentation

Integer TZUnmodifiableCollection::Add ( const IZInterface  Item  ) 

Adds a new object at the and of this collection.

Parameters:
Item an object to be added.
Returns:
a position of the added object.

Definition at line 1066 of file ZCollections.pas.

Boolean TZUnmodifiableCollection::AddAll ( const IZCollection  Col  ) 

Adds all elements from the specified collection into this collection.

Parameters:
Col a collection of objects to be added.
Returns:
True is the collection was changed.

Definition at line 1081 of file ZCollections.pas.

TZUnmodifiableCollection::Clear (  ) 

Clears the content of this collection.

Definition at line 1094 of file ZCollections.pas.

IZInterface TZUnmodifiableCollection::Clone (  ) 

Clones the instance of this object.

Returns:
a reference to the clonned object.

Reimplemented from TZAbstractObject.

Definition at line 1042 of file ZCollections.pas.

Boolean TZUnmodifiableCollection::Contains ( const IZInterface  Item  ) 

Checks is the specified object is stored in this collection.

Returns:
True if the object was found in the collection.

Definition at line 1106 of file ZCollections.pas.

Boolean TZUnmodifiableCollection::ContainsAll ( const IZCollection  Col  ) 

Checks are all the object in this collection.

Parameters:
Col a collection of objects to be checked.
Returns:
True if all objects are in this collection.

Definition at line 1120 of file ZCollections.pas.

TZUnmodifiableCollection::Delete ( Integer  Index  ) 

Deletes an object from the specified position.

Definition at line 1132 of file ZCollections.pas.

Boolean IZObject::Equals ( const IZInterface Value  )  [inherited]

Boolean TZAbstractObject::Equals ( const IZInterface  Value  )  [inherited]

Reimplemented in TZAnyValue.

TZUnmodifiableCollection::Exchange ( Integer  Index1,
Integer  Index2 
)

Exchanges two element in the collection.

Parameters:
Index1 an index of the first element.
Index2 an index of the second element.

Definition at line 1146 of file ZCollections.pas.

IZInterface TZUnmodifiableCollection::First (  ) 

Gets the first element from this collection.

Returns:
the first element.

Definition at line 1160 of file ZCollections.pas.

IZInterface TZUnmodifiableCollection::Get ( Integer  Index  ) 

Gets a collection element from the specified position.

Parameters:
Index a position index of the element.
Returns:
a requested element.

Definition at line 1173 of file ZCollections.pas.

Integer TZUnmodifiableCollection::GetCount (  ) 

Gets a number of the stored element in this collection.

Returns:
a number of stored elements.

Definition at line 1186 of file ZCollections.pas.

IZIterator TZUnmodifiableCollection::GetIterator (  ) 

Gets a created iterator for this collection.

Returns:
a created iterator for this collection.

Definition at line 1198 of file ZCollections.pas.

LongInt TZAbstractObject::Hash (  )  [inherited]

Gets a unique hash for this object.

Returns:
a unique hash for this object.

Reimplemented from IZObject.

Definition at line 462 of file ZClasses.pas.

Integer TZUnmodifiableCollection::IndexOf ( const IZInterface  Item  ) 

Defines an index of the specified object inside this colleciton.

Parameters:
Item an object to be found.
Returns:
an object position index or -1 if it was not found.

Definition at line 1211 of file ZCollections.pas.

TZUnmodifiableCollection::Insert ( Integer  Index,
const IZInterface  Item 
)

Inserts an object into specified position.

Parameters:
Index a position index.
Item an object to be inserted.

Definition at line 1225 of file ZCollections.pas.

Boolean TZAbstractObject::InstanceOf ( const TGUID  IId  )  [inherited]

Checks is this object implements a specified interface.

Parameters:
IId an interface id.
Returns:
True if this object support the interface.

Reimplemented from IZObject.

Definition at line 488 of file ZClasses.pas.

IZInterface TZUnmodifiableCollection::Last (  ) 

Gets the last object from this collection.

Returns:
the last object.

Definition at line 1239 of file ZCollections.pas.

TZUnmodifiableCollection::Put ( Integer  Index,
const IZInterface  Item 
)

Puts a specified object into defined position.

Parameters:
Index a position index.
Items ab object to be put.

Definition at line 1252 of file ZCollections.pas.

TZUnmodifiableCollection::RaiseException (  )  [private]

Raises invalid operation exception.

Definition at line 1053 of file ZCollections.pas.

Integer TZUnmodifiableCollection::Remove ( const IZInterface  Item  ) 

Removes an existed object which equals to the specified one.

Parameters:
Item an object to be removed.
Returns:
an index of the removed object.

Definition at line 1267 of file ZCollections.pas.

Boolean TZUnmodifiableCollection::RemoveAll ( const IZCollection  Col  ) 

Removes all the elements from the specified collection.

Parameters:
Col a collection of object to be removed.
Returns:
True if this collection was changed.

Definition at line 1282 of file ZCollections.pas.

string TZUnmodifiableCollection::ToString (  ) 

Gets a string representation for this object.

Reimplemented from TZAbstractObject.

Definition at line 1295 of file ZCollections.pas.


Member Data Documentation

See also:
GetCount For reading

Definition at line 318 of file ZCollections.pas.

Definition at line 224 of file ZCollections.pas.

See also:
Get For reading

Put For writing

Definition at line 321 of file ZCollections.pas.


The documentation for this class was generated from the following file:

Generated on Wed Dec 30 08:42:58 2009 for zeoslib by  doxygen 1.5.7.1