This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mlreportgen.finder.Finder class

Package: mlreportgen.finder
Superclasses:

Create A MATLAB Finder

Description

mlreportgen.finder.Finder is an abstract class of finder objects to find result objects that can be added to an mlreportgen.report.Report object. Use this class as a basis for creating your own finder class.

Properties

expand all

Container to be searched by the finder. The data type depends on the type of container to be searched. For example, for a variable name, the data type is a character vector or string.

Properties of objects to find, specified as a cell array of name-value pairs. The finder returns only objects that have the specified properties with the specified values.

Example: finder.Properties = {'Gain','5'}

Methods

results = find(finder) finds items in the container specified by the finder. This method returns the items it finds wrapped in result objects. These results objects can be added directly to reports of type mlreportgen.report.Report or slreportgen.report.Report. You can also add the results to a reporter that you then add to a report.

tf = hasNext(finder) determines if the container that the finder searches contains at least one of the specified items to find. If the container has at least one item, the hasNext method queues that item as the next item that the next method will return. The hasNext method then returns true. Use the next method to obtain that item. On subsequent calls, the hasNext method determines if the container has an item that the next method has not yet retrieved. It queues the item for the next method to retrieve and returns true. If there are no more items to be retrieved, this method returns false. To search a container progressively for items, use the hasNext method with the next method in a while loop.

result = next(finder) returns the next search result in the result queue that the hasNext method created. This method returns the item that it finds, wrapped in an mlreportgen.finder.Result object. To add tables of the item properties, add the result object to the report directly or add it to a reporter that you then add to a report. The reports to which you can add the results of this method must be of type mlreportgen.report.Report.

tf = isIterating(finder) checks whether the finder is iterating to find results. If true, you cannot change any of the finder properties.

tf = mustNotBeIterating(finder) or tf = mustNotBeIterating(finder,propertyName) validates that the finder is not iterating to find results. If true, the finder must not be iterating and you can change property values, etc. If false, the finder is iterating and you cannot change its properties, etc. The optional propertyName input is the property that is being modified and caused the error.

tf = satisfyObjectPropertiesConstraint(finder,obj) determines if the the obj has a property that satisfies the Properties constraint specified by the finder.

reset(finder) resets the finder to its initial state, such that calling next(finder) returns the first result and resets the object states.

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects (MATLAB).

Introduced in R2018a