Documentation of 'org.joone.edit.XMLNetStorageFormat' Java class
XMLNetStorageFormat
org.joone.edit

Class XMLNetStorageFormat

  • All Implemented Interfaces:
    NetStorageFormat


    public class XMLNetStorageFormat
    extends java.lang.Object
    implements NetStorageFormat
    A XMLNetStorageFormat is a XML based file format to store and restore NeuralNets. It uses XStream serialization mechanism to store NeuralNets. The XMLNetStorageFormat has the file extension "xml" (e.g. my_net.xml).
    • Constructor Summary

      Constructors 
      Constructor and Description
      XMLNetStorageFormat()
      Create a StandardNetStorageFormat for storing and restoring NeuralNets.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String createFileDescription()
      Factory method to create a file description for the file type when displaying the associated FileFilter.
      boolean equals(java.lang.Object compareObject)
      Test, whether two NetStorageFormats are the same.
      java.lang.String getFileDescription()
      Return the file description for the file type of the storage format
      java.lang.String getFileExtension()
      Return the file extension for the storage format
      javax.swing.filechooser.FileFilter getFileFilter()
      Return the FileFilter used to identify NeuralNet files with the correct file extension for this NetStorageFormat.
      NeuralNet restore(java.lang.String fileName)
      Restore a NeuralNet from a file with a given name.
      void setFileDescription(java.lang.String newFileDescription)
      Set the file description for the file type of the storage format
      void setFileExtension(java.lang.String newFileExtension)
      Set the file extension for the storage format
      void setFileFilter(javax.swing.filechooser.FileFilter newFileFilter)
      Set the FileFilter used to identify NeuralNet files with the correct file extension for this NetStorageFormat.
      java.lang.String store(java.lang.String fileName, NeuralNet saveNeuralNet)
      Store a NeuralNet under a given name.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XMLNetStorageFormat

        public XMLNetStorageFormat()
        Create a StandardNetStorageFormat for storing and restoring NeuralNets.
    • Method Detail

      • setFileExtension

        public void setFileExtension(java.lang.String newFileExtension)
        Set the file extension for the storage format
        Parameters:
        file - extension
      • getFileExtension

        public java.lang.String getFileExtension()
        Return the file extension for the storage format
        Returns:
        file extension
      • createFileDescription

        public java.lang.String createFileDescription()
        Factory method to create a file description for the file type when displaying the associated FileFilter.
        Returns:
        new file description
      • setFileDescription

        public void setFileDescription(java.lang.String newFileDescription)
        Set the file description for the file type of the storage format
        Parameters:
        newFileDescription - description of the file type
      • getFileDescription

        public java.lang.String getFileDescription()
        Return the file description for the file type of the storage format
        Returns:
        description of the file type
      • setFileFilter

        public void setFileFilter(javax.swing.filechooser.FileFilter newFileFilter)
        Set the FileFilter used to identify NeuralNet files with the correct file extension for this NetStorageFormat.
        Parameters:
        newFileFilter - FileFilter for this StorageFormat
      • getFileFilter

        public javax.swing.filechooser.FileFilter getFileFilter()
        Return the FileFilter used to identify NeuralNet files with the correct file extension for this NetStorageFormat.
        Specified by:
        getFileFilter in interface NetStorageFormat
        Returns:
        FileFilter for this StorageFormat
      • store

        public java.lang.String store(java.lang.String fileName,
                                      NeuralNet saveNeuralNet)
                               throws java.io.IOException
        Store a NeuralNet under a given name. If the file name does not have the correct file extension, then the file extension is added.
        Specified by:
        store in interface NetStorageFormat
        Parameters:
        fileName - file name of the NeuralNet under which it should be stored
        saveNeuralNet - NeuralNet to be saved
        Returns:
        file name with correct file extension
        Throws:
        java.io.IOException
      • restore

        public NeuralNet restore(java.lang.String fileName)
                          throws java.io.IOException
        Restore a NeuralNet from a file with a given name.
        Specified by:
        restore in interface NetStorageFormat
        Parameters:
        name - of the file in which the NeuralNet has been saved
        Returns:
        restored NeuralNet
        Throws:
        java.io.IOException
      • equals

        public boolean equals(java.lang.Object compareObject)
        Test, whether two NetStorageFormats are the same. They are the same if they both support the same file extension.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true, if both StorageFormats have the same file extension, false otherwise

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.