|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRPCollection
The IRPCollection interface contains methods used to store and manipulate collections of various types of elements that you may have in your Rational Rhapsody model. Collections of this type are used by methods that return multiple model elements and by certain methods that take a collection of model elements as an argument.
Method Summary | |
---|---|
void |
addGraphicalItem(IRPGraphElement newVal)
Adds a graphical element to a collection. |
void |
addItem(IRPModelElement newVal)
Adds a model element to a collection. |
void |
empty()
Used to empty out a collection. |
int |
getCount()
Returns the number of items in a collection. |
java.lang.Object |
getItem(int index)
Retrieves an item from a collection, using the index specified. |
void |
remove(int index)
Removes an element from a collection. |
void |
setInteger(int index,
int val)
Used to place an integer in a specific place in a collection. |
void |
setModelElement(int index,
IRPModelElement val)
Places an item in a specific place in a collection. |
void |
setSize(int size)
Sets the size of a collection. |
void |
setString(int index,
java.lang.String val)
Used to place a String in a specific place in a collection. |
java.util.List |
toList()
Returns a java.util.List populated with the elements in the collection. |
Method Detail |
---|
int getCount()
java.lang.Object getItem(int index)
index
- the index of the item to be retrieved (index of first element is 1, not 0)
RhapsodyRuntimeException
void addItem(IRPModelElement newVal)
newVal
- the model element to add to the collection
RhapsodyRuntimeException
void addGraphicalItem(IRPGraphElement newVal)
newVal
- the graphical element to add to the collection
RhapsodyRuntimeException
java.util.List toList()
RhapsodyRuntimeException
void setSize(int size)
size
- the new size that should be used for the collection
RhapsodyRuntimeException
void remove(int index)
index
- the index of the element that should be removed from the collection
RhapsodyRuntimeException
void setString(int index, java.lang.String val)
//The populateDiagram method takes 3 parameters, the first two being collections: a collection of model elements and a collection of strings IRPDiagram classDiagramToCreate = vehiclePackage.addObjectModelDiagram("Classes in Vehicles package"); IRPCollection classesToAddToDiagram = vehiclePackage.getClasses(); IRPCollection typesOfRelationsToShow = app.createNewCollection(); typesOfRelationsToShow.setSize(2); typesOfRelationsToShow.setString(1, "Inheritance"); typesOfRelationsToShow.setString(2, "Dependency"); classDiagramToCreate.populateDiagram(classesToAddToDiagram, typesOfRelationsToShow, "fromto");
index
- the index representing the place in the collection where the String should be placed (index of first element is 1, not 0)val
- the String to place in the collection
RhapsodyRuntimeException
void setModelElement(int index, IRPModelElement val)
index
- the index representing the place in the collection where the item should be placed (index of first element is 1, not 0)val
- the item to place in the collection
RhapsodyRuntimeException
void empty()
RhapsodyRuntimeException
void setInteger(int index, int val)
index
- the index representing the place in the collection where the integer should be placed (index of first element is 1, not 0)val
- the integer to place in the collection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |