All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

System Class CATSetValCATString

System.CATCollecRoot
  |
  +---CATSetValCATString
 

Usage: you must use this class as is. You should never derive it.


public class CATSetValCATString

Class to implement a mutable ordered set of CATString.
Role: The purpose of this class is to let C++ classes easily pass and receive sets of CATString. The class handles all the low-level memory allocation tasks such as reallocating the set once it capacity has been exceeded. Set elements are sorted by lexicographic order.
Use the type CATSetOfCATString


Constructor and Destructor Index


o CATSetValCATString()
Constructs an empty set of CATString.
o CATSetValCATString(CATSetValCATString&)
Copy constructor.
o CATSetValCATString(CATString**,int)
Constructs a set and initializes it with a C++ CATString pointer array.
o CATSetValCATString(CATString*,int)
Constructs a set and initializes it with a C++ CATString array.
o CATSetValCATString(int)
Constructs an empty set of CATString with a specific initial capacity.
o ~CATSetValCATString()
Destructor.

Method Index


o Add(CATSetValCATString&)
Union with a set.
o Add(CATString&)
Adds a CATString to the set if the set does not already contain it.
o Array(CATString*)
Fills a C++ array of CATString with elements from the set.
o Array(CATString**)
Fills a C++ array of pointers to CATString with elements from the set.
o Compare(CATSetValCATString&,CATSetValCATString&,int(*iPFCompare)(CATString*,*))
Compares two sets of CATString.
o Contains(CATSetValCATString&)
Test if the set contains the specified CATString.
o Intersection(CATSetValCATString&,CATSetValCATString&,CATSetValCATString&)
Intersection of two sets.
o Locate(CATString&)
Finds the index of a CATString in the set.
o Remove(CATSetValCATString&)
Difference of two sets.
o RemoveAll(CATCollec::MemoryHandling)
Removes all the elements from the set.
o RemovePosition(int)
Removes the CATString located at a given index.
o RemoveValue(CATString&)
Removes a CATString from the set.
o Replace(int,CATString&)
Replaces an element at a specified index with another CATString value.
o Size()
Returns the size of the set.
o operator !=(CATSetValCATString&)
Inequality operator.
o operator >(CATSetValCATString&)
Greater than operator.
o operator >=(CATSetValCATString&)
Greater than or equal to operator.
o operator <(CATSetValCATString&)
Less than operator.
o operator <=(CATSetValCATString&)
Less than or equal to operator.
o operator ==(CATSetValCATString&)
Equality operator.
o operator=(CATSetValCATString&)
Assignment operator.
o operator[](int)
Subscripting operator.

Constructor and Destructor


o CATSetValCATString
public CATSetValCATString()
Constructs an empty set of CATString.
o CATSetValCATString
public CATSetValCATString( const CATSetValCATString& iCopy)
Copy constructor.
Parameters:
iCopy
The set to copy.
o CATSetValCATString
public CATSetValCATString(CATString** iArray,
int iSize)
Constructs a set and initializes it with a C++ CATString pointer array.
Parameters:
iArray
A C++ array of CATString pointers used to initialize the set.
iSize
The size of the C++ array of CATString pointers used to initialize the set.
o CATSetValCATString
public CATSetValCATString(CATString* iArray,
int iSize)
Constructs a set and initializes it with a C++ CATString array.
Parameters:
iArray
A C++ array of
CATString used to initialize the set.
iSize
The size of the C++ array of CATString used to initialize the set.
o CATSetValCATString
public CATSetValCATString(int iInitAlloc)
Constructs an empty set of CATString with a specific initial capacity.
Parameters:
iInitAlloc
The default capacity of the set.
o ~CATSetValCATString
public ~CATSetValCATString()
Destructor.

Methods


o Add
public int Add( const CATSetValCATString& iConcat)
Union with a set.
Role: Adds all the elements from a CATString set which are not already contained by the set.
Parameters:
iConcat
The CATString set to add.
o Add
public int Add( const CATString& iAdd)
Adds a CATString to the set if the set does not already contain it.
Parameters:
iAdd
The CATString to append.
o Array
public void Array(CATString* ioArray)const
Fills a C++ array of CATString with elements from the set.
Role: The array has to have the same size as the set.
Parameters:
ioArray
The C++ array to fill.
o Array
public void Array(CATString** ioArray)const
Fills a C++ array of pointers to CATString with elements from the set.
Role: The array has to have the same size as the set.
Parameters:
ioArray
The C++ array to fill.
o Compare
public static int Compare( const CATSetValCATString& iLV1,
const CATSetValCATString& iLV2,
int(*iPFCompare)(CATString*,*) CATString)
Compares two sets of CATString.
Parameters:
iLV1
the first set of CATString.
iLV2
the second set of CATString.
iPFCompare
A pointer to a function which compares two CATString and returns -1, 0 or 1 depending on the order of the strings.
Returns:

Legal values: 0 if the sets are equal, -1 if the first set is smaller than the second set (smaller means that the first set contains less elements than the second set or that iRC1[i] < iRC2[i] for the first i where iRC1[i] != iRC2[i] and < is a lexicographic comparison of two strings), or 1 otherwise.
o Contains
public int Contains( const CATSetValCATString& iTest)
Test if the set contains the specified CATString.
Parameters:
iTest
The CATString to look up.
Returns:

Legal values: 1 if the set contains the specified CATString, 0 otherwise.
o Intersection
public static void Intersection( const CATSetValCATString& iL1,
const CATSetValCATString& iL2,
CATSetValCATString& ioResult)
Intersection of two sets.
Parameters:
iL1
The first set.
iL2
The second set.
ioResult
A set to which elements in the intersection are added.
o Locate
public int Locate( const CATString& iLocate)const
Finds the index of a CATString in the set.
Parameters:
iLocate
The CATString to locate.
Returns:

Legal values: The index of the located CATString, or 0 if the set does not contain the specified CATString.
o Remove
public int Remove( const CATSetValCATString& iSubstract)
Difference of two sets.
Role: Removes all the values specifed in iSubstract from the set.
Parameters:
iSubstract
A set of CATString to remove.
Returns:
The count of CATString removed from the set.
o RemoveAll
public void RemoveAll(CATCollec::MemoryHandling iMH= CATCollec::ReleaseAllocation )
Removes all the elements from the set.
Parameters:
iMH

Legal values: Specifies whether the set capacity should be shrunk to 0 (CATCollec::ReleaseAllocation) or not (CATCollec::KeepAllocation).
o RemovePosition
public void RemovePosition(int iIndex)
Removes the CATString located at a given index.
Parameters:
iIndex
The set index of the CATString
o RemoveValue
public int RemoveValue( const CATString& iRemove)
Removes a CATString from the set.
Parameters:
iRemove
The CATString to remove.
Returns:

Legal values: The index of the removed CATString, or 0 if the set does not contain the specified CATString.
o Replace
public int Replace(int iIndex,
const CATString& iReplace)
Replaces an element at a specified index with another CATString value.
Parameters:
iIndex
index of the element to replace.
iReplace
The new CATString value.
o Size
public int Size()const
Returns the size of the set.
Returns:
the size of the set.
o operator !=
public int operator !=( const CATSetValCATString& iLV)const
Inequality operator.
Parameters:
iLV
The set to test for inequality
Returns:

Legal values: 1 if the two sets are not equal, 0 otherwise.
o operator >
public int operator >( const CATSetValCATString& iLV)const
Greater than operator.
Parameters:
iLV
The set to compare the receiver to.
Returns:

Legal values: 1 the receiver is greater than iLV, 0 otherwise
o operator >=
public int operator >=( const CATSetValCATString& iLV)const
Greater than or equal to operator.
Parameters:
iLV
The set to compare the receiver to.
Returns:

Legal values: 1 the receiver is greater than or equal to iLV, 0 otherwise
o operator <
public int operator <( const CATSetValCATString& iLV)const
Less than operator.
Parameters:
iLV
The set to compare the receiver to.
Returns:

Legal values: 1 the receiver is less than iLV, 0 otherwise
o operator <=
public int operator <=( const CATSetValCATString& iLV)const
Less than or equal to operator.
Parameters:
iLV
The set to compare the receiver to.
Returns:

Legal values: 1 the receiver is less than or equal to iLV, 0 otherwise
o operator ==
public int operator ==( const CATSetValCATString& iLV)const
Equality operator.
Role: Two sets are equal if they contain the same elements in the same order.
Parameters:
iLV
The set to test for equality
Returns:

Legal values: 1 if the two sets are equal, 0 otherwise
o operator=
public CATSetValCATString& operator=( const CATSetValCATString& iCopy)
Assignment operator.
Role: Overwrites the content of the set with another set.
Parameters:
iCopy
The assigned set.
o operator[]
public CATString operator[](int iIndex)const
Subscripting operator.
Parameters:
iIndex
The index of the element.
Returns:
The CATString at index iIndex.

This object is included in the file: CATSetOfCATString.h
If needed, your Imakefile.mk should include the module: JS0GROUP

Copyright © 2003, Dassault Systèmes. All rights reserved.