org.joone.edit
Class NetStorageFormatManager
- java.lang.Object
-
- org.joone.edit.NetStorageFormatManager
-
public class NetStorageFormatManager extends java.lang.ObjectThe NetStorageFormatManager is a contains NetStorageFormats. It is not a Singleton because it could be necessary to deal with different format managers, e.g. one for importing NeuralNets, one for exporting NeuralNets. If one NetStorageFormat matches the file extension of the NeuralNet file, then this NetStorageFormat can be used to store or restore the NeuralNet.- See Also:
StorageFormat
-
-
Constructor Summary
Constructors Constructor and Description NetStorageFormatManager()Create a new NetStorageFormatManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddStorageFormat(NetStorageFormat newStorageFormat)Add a NetStorageFormat that should be supported by this NetStorageFormatManager.booleancontainsStorageFormat(NetStorageFormat checkStorageFormat)Test, whether a NetStorageFormat is supported by this StorageFormatNetStorageFormatfindStorageFormat(javax.swing.filechooser.FileFilter findFileFilter)Find a NetStorageFormat that can be used according to a FileFilter to store a NeuralNet in a file or restore it from a file respectively.NetStorageFormatgetDefaultStorageFormat()Return the NetStorageFormat which is used as selected file format in a javax.swing.JFileChooservoidregisterFileFilters(javax.swing.JFileChooser fileChooser)Register all FileFilters supported by NetStorageFormatsvoidremoveStorageFormat(NetStorageFormat oldStorageFormat)Remove a StorageFormat that should no longer be supported by this StorageFormatManager.voidsetDefaultStorageFormat(NetStorageFormat newDefaultStorageFormat)Set a NetStorageFormat as the default storage format which is selected in a javax.swing.JFileChooser.
-
-
-
Constructor Detail
-
NetStorageFormatManager
public NetStorageFormatManager()
Create a new NetStorageFormatManager.
-
-
Method Detail
-
addStorageFormat
public void addStorageFormat(NetStorageFormat newStorageFormat)
Add a NetStorageFormat that should be supported by this NetStorageFormatManager.- Parameters:
newStorageFormat- new NetStorageFormat to be supported
-
removeStorageFormat
public void removeStorageFormat(NetStorageFormat oldStorageFormat)
Remove a StorageFormat that should no longer be supported by this StorageFormatManager. The StorageFormat is excluded in when search for a StorageFormat.- Parameters:
oldStorageFormat- old NetStorageFormat no longer to be supported
-
containsStorageFormat
public boolean containsStorageFormat(NetStorageFormat checkStorageFormat)
Test, whether a NetStorageFormat is supported by this StorageFormat
-
setDefaultStorageFormat
public void setDefaultStorageFormat(NetStorageFormat newDefaultStorageFormat)
Set a NetStorageFormat as the default storage format which is selected in a javax.swing.JFileChooser. The default storage format must be already added with addStorageFormat. Setting the default storage format to null does not automatically remove the StorageFormat from the list of supported StorageFormats.- Parameters:
newDefaultStorageFormat- StorageFormat that should be selected in a JFileChooser
-
getDefaultStorageFormat
public NetStorageFormat getDefaultStorageFormat()
Return the NetStorageFormat which is used as selected file format in a javax.swing.JFileChooser- Returns:
- default storage format
-
registerFileFilters
public void registerFileFilters(javax.swing.JFileChooser fileChooser)
Register all FileFilters supported by NetStorageFormats- Parameters:
fileChooser- javax.swing.JFileChooser to which FileFilters are added
-
findStorageFormat
public NetStorageFormat findStorageFormat(javax.swing.filechooser.FileFilter findFileFilter)
Find a NetStorageFormat that can be used according to a FileFilter to store a NeuralNet in a file or restore it from a file respectively.- Parameters:
findFileFilter- FileFilter used to identify a NetStorageFormat- Returns:
- NetStorageFormat, if a matching file extension could be found, false otherwise
-
-
DataMelt 3.0 © DataMelt by jWork.ORG