All Frameworks Class Hierarchy This Framework Previous Next Indexes
KnowledgeInterfaces Interface CATIList
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---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
GetOperation()
- Returns the operation associated to the list.
- o
GetOperationResult(CATICkeParm_var&)
- Returns the result of the operation on elements of the list, like 1+2+3+4.
- 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 HRESULT AllowDuplicateElements( | int | iDuplicate) = 0 |
-
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 int GetIndexOfItem( | CATBaseUnknown* | iValue, |
| int | iStartIndex | = 1) = 0 |
-
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
-
- 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
-
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
-
Returns the type allowed for elements of the list.
Returns a null string if type is not set.
o GetOperation
-
Returns the operation associated to the list.
o GetOperationResult
public virtual HRESULT GetOperationResult( | CATICkeParm_var& | oResult) = 0 |
-
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 GetSize
public virtual int GetSize( | )= 0 |
-
Returns the size of the list.
i.e. non null elements of the list.
- Returns:
- list size.
o GetSortingExpression
-
Gets the sorting expression used to sort the list.
Returns an empty String if there is no expression.
o InsertItem
-
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 int IsDuplicateElementsAllowed( | )= 0 |
-
Indicates if the list can contain duplicate items.
- Returns:
- 1 if elements can be duplicated, 0 otherwise.
o IsListTypeLocked
public virtual int IsListTypeLocked( | )= 0 |
-
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 int IsSorted( | )= 0 |
-
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 int IsTypeSet( | )= 0 |
-
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 HRESULT LockListType( | )= 0 |
-
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 HRESULT RemoveAll( | )= 0 |
-
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 HRESULT RemoveItem( | int | index) = 0 |
-
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 HRESULT Reorder( | int | iCurrent, |
| int | iTarget) = 0 |
-
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
-
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
-
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
-
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
-
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 HRESULT UnLockListType( | )= 0 |
-
UnLocks the List type modifications.
- Returns:
- E_FAIL if the list type has not been valuated.
o UnsetListType
public virtual HRESULT UnsetListType( | )= 0 |
-
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