Persistate API documentation
IndexedList<(Of <(<'T>)>)> Class
NamespacesPersistateIndexedList<(Of <(<'T>)>)>

[This is preliminary documentation and is subject to change.]

This is a generic collection class designed to allow easy creation of strongly typed collections containing automatically maintained indexes.
Declaration Syntax
Generic Template Parameters
The type of objects contained in the IndexedList. This must be derived from Persistent.
All MembersConstructorsMethodsPropertiesEvents

IndexedList<(Of <(<'T>)>)>()()()()
This constructor is used when deserialising IndexedLists. It should not be used in open code.

IndexedList<(Of <(<'T>)>)>(Message, Persistent, Int32)
Creates a new empty IndexedList from information stored in a Message.

IndexedList<(Of <(<'T>)>)>(ObjectClass, Persistent, FlagSet, Int32, Boolean, Int32, Int32)
Creates a new IndexedList and optionally fills it from the database.

Adds an object to the end of a collection.

Adds a T object to the end of a collection.

Adds an object to the collection, but only if the object is not already contained in it.

AddRange(IEnumerable<(Of <<'(T>)>>))
Adds the elements of a collection to the IndexedList.

CallTree(CallTreeData, Int32)
Provides support for the general persistent tree caller scheme.

This event is raised whenever the collection may have changed.

Gets the ObjectClass of elements of this collection.

Clears the IndexedList in memory only.

Returns true if the given object (not T) is in the collection. This works because of the constraint on T

Determines whether the collection contains a specific object.

CopyTo(Array, Int32)
Copies the contents of the collection to an array.

CopyTo(array<T>[]()[][], Int32)
Copies the elements of the collection to an Array, starting at a particular Array index.

Gets the number of elements contained in this collection.

Ensures that all Dictionary indexes for this IndexedList have been created.

Determines if this list is the same list as another one.

Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Exclude(Persistent, Boolean)
This method supports the Persistate infrastructure and should not be used in open code.

Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Gets the first element in the IndexedList, or null if the list is empty

Gets the FlagSet for this collection.

Finds the default Layout for this collection.

Gets an enumerator for the elements of the collection

Serves as a hash function for a particular type.
(Inherited from Object.)
Gets the Type of the current instance.
(Inherited from Object.)
Include(Persistent, Boolean)
This method supports the Persistate infrastructure and should not be used in open code.

Returns the index of the given object (not T) in the collection.

Returns the position of an object in the collection.

Insert(Int32, Object)
Inserts an object at the given position in the collection.

Insert(Int32, T)
Inserts an object into the list at a particular position.

Gets a value indicating whether this is an associated collection.

Gets a value indicating whether this is a diverse collection.

Gets a value indicating whether the IndexedList is fixed size. Always false.

Gets a value indicating whether this is an ordered collection.

Gets a value indicating whether the IndexedList is read-only. Always false.

Gets a value indicating whether the IndexedList is synchronised. Always true.

Item[([( Int32])])
Gets or Sets a T object at a particular numerical position in the collection.

Item[([( String])])
Looks up an object in the IndexedList by string key.

Item[([( Int32, Object])])
Looks up an object in the IndexedList by key.

Gets the last element in the IndexedList, or null if the list is empty

Creates a shallow copy of the current Object.
(Inherited from Object.)
Moves an object downwards in an ordered collection, i.e. towards the end.

Moves an object upwards in an ordered collection, i.e. towards the start.

Gets nominative text for this collection.

Raises the Changed event for this collection with a null containee and Refresh reason.

OnChanged(Persistent, LinkageEventArgs..::..EventReason)
Raises the Changed event for this collection with a particular containee and reason.

Gets the parent object of the elements in the list.

Refreshes the collection from persistent storage.

Retrieves all objects in a many" type collection from persistent storage.

This ensures that the given object's index entries are up to date in the IndexedList.

Removes an object from the collection.

Removes a T object from the collection.

Removes all objects from the collection.

Removes the object at a particular position in the collection.

Resets the index for the given key.

Saves information about this IndexedList to a Message.

Gets the slot of the Member in the parent's ObjectClass that corresponds to this collection.

Gets an object to use for locking this collection.

Gets a title for this collection.

Copies the objects in the collection to a new array.

Obtains a string describing the contents of the IndexedList
(Overrides Object.ToString()()()().)

This is a persistent collection class, so when you add or remove an object from the collection, at the end of the current Operation execution, or on the next Session.Commit, the changes are replicated in persistent storage.

Most of the public methods of this class are thread safe. The only methods which are not thread safe are CallTree method and the GetEnumerator method. You can obtain the object used by public methods for locking the collection using the SyncRoot property.

This class provides indexing using the distinctive properties within the element class of the collection. IndexedList uses Dictionary objects for each such key property, which allows object lookup in the collection using any of these. Each Dictionary is created only when a lookup is first requested on that particular table. This means that in cases where a lookup for a given key is not used, the Dictionary will never be created. Once a Dictionary is created, it is automatically maintained as objects are added and removed from the collection, but if you alter a key property value in one of the elements, you need to update the Dictionary using the Reindex method.

There are two ways IndexedLists can be created - ordered or not. An ordered IndexedList is created for collections defined with the "ordered" modifier in the Persistate definition file. The class of the elements of ordered IndexedLists must be defined with the "orderable" category, or any other category which has the "allow order" function. In this case the class is given an Order property, used here, which implements the IOrderable interface.

In ordered IndexedLists, elements always appear in the list at the position given by their Order property. This means that there can be gaps in the list, filled with null entries, if no element has a particular Order value. In addition, when you add, insert or remove elements from ordered IndexedLists, the Order properties of other elements are adjusted appropriately. If you add an element to an ordered IndexedList which is beyond its current size, then the size is increased to accommodate the new element, and any gap created is filled with nulls

IndexedList elements can be accessed by the standard integer indexer. There is a two parameter indexer which can be used to access the key indexes - the first parameter is the key number, the second is the value. Each ObjectClass has key number constants defined in generated code for this purpose. There is also a single parameter string indexer. This can be used to access the key index for the first distinctive string member defined for the element class in the definition file.

Inheritance Hierarchy
IndexedList<(Of <(<'T>)>)>

Assembly: Persistate (Module: Persistate) Version: (