TZCollection Class Reference

Implenments a collection of interfaces. More...

Inheritance diagram for TZCollection:

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.
 TZCollection ()
 Creates this collection and assignes main properties.
 ~TZCollection ()
 Destroys this object and frees the memory.

Public Attributes

Integer Count
IZInterface Items

Protected Member Functions

 Error (const string Msg, Integer Data)
 Raises a collection error.
 Grow ()
 Increases an element count.
 SetCapacity (Integer NewCapacity)
 Sets a new list capacity.
 SetCount (Integer NewCount)
 Sets a new element count.

Private Member Functions

Boolean Equals (const IZInterface &Value)

Private Attributes

Integer FCapacity
Integer FCount
PZInterfaceList FList


Detailed Description

Implenments a collection of interfaces.

Definition at line 95 of file ZCollections.pas.


Constructor & Destructor Documentation

TZCollection::TZCollection (  ) 

Creates this collection and assignes main properties.

Definition at line 488 of file ZCollections.pas.

References R.

TZCollection::~TZCollection (  ) 

Destroys this object and frees the memory.

Definition at line 498 of file ZCollections.pas.


Member Function Documentation

Integer TZCollection::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 650 of file ZCollections.pas.

Boolean TZCollection::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 669 of file ZCollections.pas.

TZCollection::Clear (  ) 

Clears the content of this collection.

Definition at line 690 of file ZCollections.pas.

IZInterface TZCollection::Clone (  ) 

Clones the instance of this object.

Returns:
a reference to the clonned object.

Reimplemented from TZAbstractObject.

Definition at line 623 of file ZCollections.pas.

Boolean TZCollection::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 703 of file ZCollections.pas.

Boolean TZCollection::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 717 of file ZCollections.pas.

TZCollection::Delete ( Integer  Index  ) 

Deletes an object from the specified position.

Definition at line 740 of file ZCollections.pas.

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

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

Reimplemented in TZAnyValue.

class TZCollection::Error ( const string  Msg,
Integer  Data 
) [protected]

Raises a collection error.

Parameters:
Msg an error message.
Data a integer value to describe an error.

Definition at line 511 of file ZCollections.pas.

TZCollection::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 763 of file ZCollections.pas.

IZInterface TZCollection::First (  ) 

Gets the first element from this collection.

Returns:
the first element.

Definition at line 793 of file ZCollections.pas.

IZInterface TZCollection::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 806 of file ZCollections.pas.

Integer TZCollection::GetCount (  ) 

Gets a number of the stored element in this collection.

Returns:
a number of stored elements.

Definition at line 824 of file ZCollections.pas.

IZIterator TZCollection::GetIterator (  ) 

Gets a created iterator for this collection.

Returns:
a created iterator for this collection.

Definition at line 836 of file ZCollections.pas.

TZCollection::Grow (  )  [protected]

Increases an element count.

Definition at line 545 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 TZCollection::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 849 of file ZCollections.pas.

TZCollection::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 890 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 TZCollection::Last (  ) 

Gets the last object from this collection.

Returns:
the last object.

Definition at line 916 of file ZCollections.pas.

TZCollection::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 929 of file ZCollections.pas.

Integer TZCollection::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 950 of file ZCollections.pas.

Boolean TZCollection::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 966 of file ZCollections.pas.

TZCollection::SetCapacity ( Integer  NewCapacity  )  [protected]

Sets a new list capacity.

Parameters:
NewCapacity a new list capacity.

Definition at line 571 of file ZCollections.pas.

TZCollection::SetCount ( Integer  NewCount  )  [protected]

Sets a new element count.

Parameters:
NewCount a new element count.

Definition at line 593 of file ZCollections.pas.

string TZCollection::ToString (  ) 

Gets a string representation for this object.

Reimplemented from TZAbstractObject.

Definition at line 987 of file ZCollections.pas.


Member Data Documentation

See also:
GetCount For reading

Definition at line 210 of file ZCollections.pas.

Integer TZCollection::FCapacity [private]

Definition at line 104 of file ZCollections.pas.

Integer TZCollection::FCount [private]

Definition at line 102 of file ZCollections.pas.

Definition at line 100 of file ZCollections.pas.

See also:
Get For reading

Put For writing

Definition at line 213 of file ZCollections.pas.


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

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