Main Content

hasNext

Class: systemcomposer.rptgen.finder.DictionaryFinder
Namespace: systemcomposer.rptgen.finder

Determine if dictionary search result queue is nonempty

Since R2022b

Syntax

nonempty = hasNext(finder)

Description

nonempty = hasNext(finder) determines whether the Dictionary search result queue is nonempty.

Input Arguments

expand all

Dictionary finder, specified as a systemcomposer.rptgen.finder.DictionaryFinder object.

Output Arguments

expand all

Whether queue is nonempty, returned as 1 (true) or 0 (false).

Data Types: logical

Examples

expand all

Use the DictionaryFinder and DictionaryResult classes to generate a report.

import mlreportgen.report.*
import slreportgen.report.*
import systemcomposer.rptgen.finder.*

scKeylessEntrySystem
model_name = "KeylessEntryArchitecture";
model = systemcomposer.loadModel(model_name);
rpt = slreportgen.report.Report(output="DictionaryFinderReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title",sprintf('Dictionaries in %s Model',model_name)));
add(rpt,TableOfContents);

dictFinder = DictionaryFinder(model_name);

chapter = Chapter("Title","Dictionaries");
while hasNext(dictFinder)
    dict = next(dictFinder);
    sect = Section("Title",dict.Name);
    add(sect,dict);
    add(chapter,sect);
end

add(rpt,chapter);
close(rpt);
rptview(rpt)

Version History

Introduced in R2022b