Documentation of 'CH.ifa.draw.util.SerializationStorageFormat' Java class
SerializationStorageFormat
CH.ifa.draw.util

Class SerializationStorageFormat

  • All Implemented Interfaces:
    StorageFormat


    public class SerializationStorageFormat
    extends StandardStorageFormat
    A SerializationStorageFormat is a straight-forward file format to store and restore Drawings. It uses Java's serialization mechanism to store Drawings. The SerializationStorageFormat has the file extension "ser" (e.g. my_picasso.ser).
    • Constructor Detail

      • SerializationStorageFormat

        public SerializationStorageFormat()
        Create a SerialzationStorageFormat for storing and restoring Drawings.
    • Method Detail

      • createFileDescription

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

        public java.lang.String store(java.lang.String fileName,
                                      Drawing saveDrawing)
                               throws java.io.IOException
        Store a Drawing under a given name. The name should be valid with regard to the FileFilter that means, it should already contain the appropriate file extension.
        Specified by:
        store in interface StorageFormat
        Overrides:
        store in class StandardStorageFormat
        Parameters:
        fileName - file name of the Drawing under which it should be stored
        saveDrawing - drawing to be saved
        Returns:
        file name with correct file extension
        Throws:
        java.io.IOException
      • restore

        public Drawing restore(java.lang.String fileName)
                        throws java.io.IOException
        Restore a Drawing from a file with a given name. The name must be should with regard to the FileFilter that means, it should have the appropriate file extension.
        Specified by:
        restore in interface StorageFormat
        Overrides:
        restore in class StandardStorageFormat
        Parameters:
        name - of the file in which the Drawing has been saved
        Returns:
        restored Drawing
        Throws:
        java.io.IOException

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.