1 package fr.ove.openmath.mathematica;
2
3 import java.io.File;
4
5 /***
6 * An interface to implement to be condidered as savable.
7 */
8 public interface Savable {
9 /***
10 * Saves the instance.
11 * @returns the result of the save action. Should be <CODE>null</CODE> if nothing
12 * is expected after the save operation. The saved object otherwise.
13 */
14 public Object save();
15
16 /***
17 * Saves the instance into the specified file.
18 * @returns the result of the save action. Should be <CODE>null</CODE> if nothing
19 * is expected after the save operation. The saved object otherwise.
20 */
21 public Object save(File file);
22
23 /***
24 * Saves the instance with the specified name.
25 * @param name the specified name.
26 * @returns the result of the save action. Should be <CODE>null</CODE> if nothing
27 * is expected after the save operation. The saved object otherwise.
28 */
29 public Object saveAs(String name);
30
31 /***
32 * Checks if the instance need to be saved.
33 * @return <CODE>true</CODE> if the instance need to be saved. <CODE>false</CODE> otherwise.
34 */
35 public boolean isSaveNeeded();
36
37 /***
38 * Sets if the instance need to be saved.
39 * @param needed <CODE>true</CODE> if the instance need to be saved. <CODE>false</CODE> otherwise.
40 */
41 public void setSaveNeeded(boolean needed);
42 }