package com.jmatio.io;
import java.util.HashSet;
import java.util.Set;
/**
* File filter.
*
* This class is used to tell MatFileReader
which matrices
* should be processed. This is useful when operating on big MAT-files,
* when there's no need to load all arrays into memory.
*
* Usage:
*
* //create new filter instance * MatFileFilter filter = new MatFileFilter(); * //add a needle * filter.addArrayName( "your_array_name" ); * * //read array form file (haystack) looking _only_ for pecified array (needle) * MatFileReader mfr = new MatFileReader( fileName, filter ); ** * @see com.jmatio.io.MatFileReader * @author Wojciech Gradkowski (wgradkowski@gmail.com) */ public class MatFileFilter { private Set
true
if array (matrix) of this name should be processed
*/
public boolean matches( String name )
{
if ( filter.size() == 0 )
{
return true;
}
return filter.contains( name );
}
}