Search services

 

Overview of the JSearch metaclass

Figure 12 shows the JSearch metaclass, complete with its methods and attributes.

 

Figure 12. The JSearch metaclass

 

 

JSearch methods

The following methods are contained in the JSearch metaclass:

runSearch()

This runs or re-runs the search.  This method takes as its parameters the different options positioned on the JSearch class and runs the search according to these options.

 

nextSearch()

This is used in the step by step search mode, and is used to continue a search or launch it for the first time.  It returns only one element.

 

initObject(Object)

This method is used to initialize the structure using the default values, and takes as its parameter the object from which the search is to be run.

 

eraseAllResults()

This method is used to delete all those elements found. 

 

Note:      This method must be called before either destroying the JSearch or saving the results and destroying them later, as this operation is the responsibility of the user.

 

 

JSearch attributes

The JSearch metaclass has the following attributes for all search contexts:

·         expression: The "expression" attribute indicates the expression which is to be searched for (by default, this is empty).

·         option: The "option" attribute specifies the correspondence between the expression to be searched for and the string used in matches.  Options are 0 for "contains", 1 for "begin with", 2 for "ends with" and 3 for "matches exactly".  By default, this is set to 0.

·         caseSensitive: The "caseSensitive" attribute indicates whether or not the search should distinguish between uppercase and lowercase characters (by default, this is set to false).

·         searchType: The "searchType" attribute indicates the type of search to be run, so as to indicate what type of elements the search is to find.  Options are 0 for "Text", 1 for "All", 2 for "Model" and 3 for "Diagram".  By default, this is set to 2.

 

The JSearch metaclass has the following attributes for searches in diagrams:

·         diagramElementType: The "diagramElementType" attribute indicates the metaclass of the element searched for (by default, this is set to "All").

·         diagramType: The "diagramType" attribute specifies the metaclass of the diagram in which the search is to be carried out (by default, this is set to "All").

 

The JSearch metaclass has the following attributes for searches in textual elements (notes, constraints):

·         noteParentType: The "noteParentType" attribute indicates the metaclass of the note's parent (by default, this is set to "All").

·         noteType: The "noteType" attribute specifies the type of note (by default, this is set to "All").

 

The JSearch metaclass has the following attributes for searches in the model:

·         modelType: The "modelType" attribute indicates the metaclass of the model element searched for.

 

 

Overview of the JResultSearch metaclass

Figure 13 shows the JResultSearch metaclass, complete with its methods.

 

Figure 13. The JResultSearch metaclass

 

 

JResultSearch methods

The following methods are contained in the JResultSearch metaclass:

getSymbol ()

This method is redefined in the different JResults and returns a character string which corresponds to the definition of the result, and more particularly, those elements found.

 

action ()

This method is used, in the context of a simple object, to select the object in the explorer.  For searches in diagrams, diagrams are selected and also opened.

 

 

Overview of the JResultText metaclass

Figure 14 shows the JResultText metaclass, complete with its attributes.

 

Figure 14. The JResultText metaclass

 

 

JResultText attributes

The JResultText metaclass has the following attributes:

·         referencedLine: The "referencedLine" attribute indicates the line where the string has been found.

·         referencedString: The "referencedString" attribute gives the contents of the entire line where the string has been found.