All Frameworks Class Hierarchy This Framework Indexes
KnowledgeInterfaces Interface CATIList
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATIList
Interface dedicated to the management of list objects.
A list is an ordered collection of items, which are features.
Type description:
Name = List.
Attributes: (default value)
Size (0 if empty)
SortExpression String ("")
IsSorted Boolean (false)
ListType String ("")
Method Index
- o
AllowDuplicateElements(int)
- Prevents or allows duplication of elements.
- o
GetIndexOfItem(CATBaseUnknown*,int)
- Retrieves the position of the first occurence if the item in the list,
starting from the index iStartIndex included.
- o
GetItem(int)
-
- o
GetItem(int,CATBaseUnknown_var&)
- Retrieves an item in the list.
- o
GetListType()
- Returns the type allowed for elements of the list.
- o
GetOperationResult(CATICkeParm_var&)
- Returns the result of the operation on elements of the list, like 1+2+3+4.
- o
GetOperation()
- Returns the operation associated to the list.
- o
GetSize()
- Returns the size of the list.
- o
GetSortingExpression()
- Gets the sorting expression used to sort the list.
- o
InsertItem(int,CATBaseUnknown*)
- Insert an item in the list.
- o
IsDuplicateElementsAllowed()
- Indicates if the list can contain duplicate items.
- o
IsListTypeLocked()
- Indicates if the list type has been locked.
- o
IsSorted()
- Indicates if the list is sorted.
- o
IsTypeSet()
- Indicates if the type of the elements of the list has been set.
- o
LockListType()
- Locks the type of the items in the list for users modifications.
- o
RemoveAll()
- Removes all the items from the list.
- o
RemoveItem(int)
- Removes an item from the list.
- o
Reorder(int,int)
- Reorders an element by moving it from current position to target position.
- o
SetItem(int,CATBaseUnknown*)
- Sets an item in the list.
- o
SetListType(CATUnicodeString&)
- Limits the elements in the list to instances of a certain type.
- o
SetOperation(CATUnicodeString&)
- Sets an operation to compute a result.
- o
SetSortingExpression(CATUnicodeString&)
- Sets a sorting expression used to sort the list.
- o
Sort()
- Sorts the list.
- o
UnLockListType()
- UnLocks the List type modifications.
- o
UnsetListType()
- Authorizes objects of any type to be put in the list.
Methods
o AllowDuplicateElements
| public virtual AllowDuplicateElements( | | iDuplicate) |
-
Prevents or allows duplication of elements. Allowed by default.
If iDuplicate is 0, prevents, otherwise, allows duplication.
Note this method doesn't remove duplicate elements already present.
It just allows to set whether duplicates should be alloed or not.
o GetIndexOfItem
| public virtual GetIndexOfItem( | | iValue, |
| | iStartIndex | = 1) |
-
Retrieves the position of the first occurence if the item in the list,
starting from the index iStartIndex included.
- Returns:
- index of the item and 0 if the item is not found.
o GetItem
| public virtual GetItem( | | index) |
-
- Deprecated:
- V5R16
Use virtual HRESULT GetItem(int iIndex, CATBaseUnknown* iItem) instead.
Retrieves an item in the list.
Return 0 if the index is not correct or empty.
o GetItem
| public virtual GetItem( | | iIndex, |
| | oItem) |
-
Retrieves an item in the list.
- Parameters:
-
- iIndex
- Starts at 1.
- oItem
- Object to return.
- Returns:
-
Legal values:
- S_OK
- if the index is comprised between 1 and the size of the list
and the returned object is different from NULL.
- S_FALSE
- if the index is comprised between 1 and the size of the list
but the returned object is equal to NULL.
- E_FAIL
- else.
o GetListType
| public virtual GetListType( | ) |
-
Returns the type allowed for elements of the list.
Returns a null string if type is not set.
o GetOperationResult
| public virtual GetOperationResult( | | oResult) |
-
Returns the result of the operation on elements of the list, like 1+2+3+4.
- Returns:
- E_FAIL if no operation defined (NONE operation).
o GetOperation
| public virtual GetOperation( | ) |
-
Returns the operation associated to the list.
o GetSize
-
Returns the size of the list.
i.e. non null elements of the list.
- Returns:
- list size.
o GetSortingExpression
| public virtual GetSortingExpression( | ) |
-
Gets the sorting expression used to sort the list.
Returns an empty String if there is no expression.
o InsertItem
| public virtual InsertItem( | | index, |
| | iValue) |
-
Insert an item in the list. Does an AddRef on the item.
- Returns:
-
- S_OK
- if the index is comprised between
1 and the size of the list and if the object type is correct.
- E_FAIL
- if the object type is not correct,
if index is out of bounds or if you try to insert an already
existing element while IsDuplicateElementsAllowed is equal to
FALSE.
o IsDuplicateElementsAllowed
| public virtual IsDuplicateElementsAllowed( | ) |
-
Indicates if the list can contain duplicate items.
- Returns:
- 1 if elements can be duplicated, 0 otherwise.
o IsListTypeLocked
| public virtual IsListTypeLocked( | ) |
-
Indicates if the list type has been locked.
- Returns:
- 1 if the list type is locked,0 if it is not Locked.
o IsSorted
| public virtual IsSorted( | ) |
-
Indicates if the list is sorted.
- Returns:
- 1 if the list is sorted according to its sorting expression,0 if it is not sorted.
o IsTypeSet
| public virtual IsTypeSet( | ) |
-
Indicates if the type of the elements of the list has been set.
- Returns:
- 1 if elements of the list must be of a given type, 0 otherwise.
o LockListType
| public virtual LockListType( | ) |
-
Locks the type of the items in the list for users modifications.
- Returns:
- E_FAIL if the list type has not been valuated.
o RemoveAll
| public virtual RemoveAll( | ) |
-
Removes all the items from the list. Does a Release on the items.
- Returns:
-
- S_OK
- if the the operation succeeded
and if all the objects have been removed.
- E_FAIL
- if the objects have not been removed.
o RemoveItem
| public virtual RemoveItem( | | index) |
-
Removes an item from the list. Does a Release on the item.
This method pushes back all following items of the list.
- Returns:
-
- S_OK
- if the index is comprised between
1 and the size of the list and if the operation succeeded.
- E_FAIL
- if the object has not been removed
or if index is out of bounds.
o Reorder
| public virtual Reorder( | | iCurrent, |
| | iTarget) |
-
Reorders an element by moving it from current position to target position.
Doesn't change the list if either position is out of the list.
- Returns:
-
- S_OK
- if the the operation succeeded.
- E_FAIL
- if cannot reorder.
o SetItem
| public virtual SetItem( | | index, |
| | iValue) |
-
Sets an item in the list. Does an AddRef on the item.
- Returns:
-
- S_OK
- if the index is comprised between
0 (means append) and the size of the list and if the
object type is correct.
- E_FAIL
- if the object type is not correct,
if index is out of bounds or if you try to insert an already
existing element while IsDuplicateElementsAllowed is equal to
FALSE.
o SetListType
| public virtual SetListType( | const | iTypeName) |
-
Limits the elements in the list to instances of a certain type.
If there are already elements of another type, returns E_FAIL.
Note the argument should be a type structure, but which one???
Passing a null argument will have same effect as UnsetListType.
o SetOperation
| public virtual SetOperation( | const | iOperation) |
-
Sets an operation to compute a result. The operation is effected between
elements of the list that follow one another:
For instance if operation is f(x,y) and list has elements 1,2,3,4,
The result is f(f(f(1,2),3),4). with f = +, this means 1+2+3+4
o SetSortingExpression
| public virtual SetSortingExpression( | const | iExpression) |
-
Sets a sorting expression used to sort the list.
The sorting expression must take two parameters, and will be called
for both parameters. They are to be called a1 and a2.
o Sort
-
Sorts the list.
Returns E_FAIL if there is no sorting expression, or the list
cannot manage sorting.
o UnLockListType
| public virtual UnLockListType( | ) |
-
UnLocks the List type modifications.
- Returns:
- E_FAIL if the list type has not been valuated.
o UnsetListType
| public virtual UnsetListType( | ) |
-
Authorizes objects of any type to be put in the list.
This object is included in the file: CATIList.h
If needed, your Imakefile.mk should include the module: KnowledgeItf