[This is preliminary documentation and is subject to change.]
C# |
public class IndexedList<T> : IPersistateList, IClassified, IEquatable<IPersistateList>, IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable where T : Persistent
- T
- The type of objects contained in the IndexedList. This must be derived from Persistent.
All Members | Constructors | Methods | Properties | Events | |
Icon | Member | Description |
---|---|---|
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. | |
Add(Object) | Adds an object to the end of a collection. | |
Add(T) | Adds a T object to the end of a collection. | |
AddIfAbsent(T) | 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.
| |
Changed | This event is raised whenever the collection may have changed.
| |
Class | Gets the ObjectClass of elements of
this collection. | |
Clear()()()() | Clears the IndexedList in memory only. | |
Contains(Object) | Returns true if the given object (not T) is in the
collection. This works because of the constraint on T | |
Contains(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. | |
Count |
Gets the number of elements contained in this collection.
| |
EnsureIndexes()()()() | Ensures that all Dictionary indexes for this IndexedList have
been created. | |
Equals(IPersistateList) |
Determines if this list is the same list as another one.
| |
Equals(Object) | (Inherited from Object.) | |
Exclude(Persistent, Boolean) | This method supports the Persistate infrastructure and should not
be used in open code. | |
Finalize()()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
First |
Gets the first element in the IndexedList, or null if the list is empty
| |
Flags | Gets the FlagSet for this collection.
| |
GetDefaultLayout()()()() | Finds the default Layout for this
collection. | |
GetEnumerator()()()() | Gets an enumerator for the elements of the collection | |
GetHashCode()()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
GetType()()()() |
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. | |
IndexOf(Object) | Returns the index of the given object (not T) in the
collection. | |
IndexOf(T) | 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. | |
IsAssociated |
Gets a value indicating whether this is an associated collection.
| |
IsDiverse |
Gets a value indicating whether this is a diverse collection.
| |
IsFixedSize |
Gets a value indicating whether the IndexedList is fixed size. Always false.
| |
IsOrdered |
Gets a value indicating whether this is an ordered collection.
| |
IsReadOnly |
Gets a value indicating whether the IndexedList is read-only. Always false.
| |
IsSynchronized |
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. | |
Last |
Gets the last element in the IndexedList, or null if the list is empty
| |
MemberwiseClone()()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
MoveDown(IOrderable) | Moves an object downwards in an ordered collection, i.e. towards
the end. | |
MoveUp(IOrderable) | Moves an object upwards in an ordered collection, i.e. towards
the start. | |
NominativeText | Gets nominative text for this collection. | |
OnChanged()()()() |
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.
| |
Parent |
Gets the parent object of the elements in the list.
| |
Refresh()()()() | Refreshes the collection from persistent storage. | |
RefreshMany()()()() | Retrieves all objects in a many" type collection from
persistent storage. | |
Reindex(T) | This ensures that the given object's index entries are up to date
in the IndexedList. | |
Remove(Object) | Removes an object from the collection. | |
Remove(T) | Removes a T object from the collection. | |
RemoveAll()()()() | Removes all objects from the collection. | |
RemoveAt(Int32) | Removes the object at a particular position in the collection.
| |
ResetIndex(Int32) | Resets the index for the given key. | |
SaveToMessage(Message) | Saves information about this IndexedList to a Message. | |
Slot | Gets the slot of the Member in the
parent's ObjectClass that corresponds to this
collection. | |
SyncRoot |
Gets an object to use for locking this collection.
| |
TitleText | Gets a title for this collection. | |
ToArray()()()() | Copies the objects in the collection to a new array. | |
ToString()()()() | 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.
Object | |
IndexedList<(Of <(<'T>)>)> |