Main Content

currentFileIndexComparator

Class: matlab.io.datastore.FileWritable
Namespace: matlab.io.datastore

Compare file indices

Since R2020a

Syntax

tf = currentFileIndexComparator(ds,ind)

Description

tf = currentFileIndexComparator(ds,ind) compares the write index ind to the read index of the current file being read by the datastore. The result is a logical 1 (true) when the indices are the same, and a logical 0 (false) otherwise. This provides an indication of the number of reads per file.

If your custom datastore subclasses from matlab.io.datastore.FileWritable, then it inherits a currentFileIndexComparator method that always returns false. If the datastore primarily works with files that require multiple reads per file, then you must implement your own getCurrentFilename and currentFileIndexComparator methods in the subclass. These methods tell the datastore which file is being read, and whether the file requires multiple reads.

Input Arguments

expand all

Input datastore, specified as a datastore object that inherits from matlab.io.datastore.FileWritable. To create a datastore object, see matlab.io.Datastore.

Write index, specified as a positive integer scalar.

Attributes

Accessprotected

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2020a