Package arc.util
Class Autosaver
java.lang.Object
arc.util.Autosaver
Save periodically the registered
Autosaver.Saveables and also when the application exit.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefines a things that can be saved by theAutosaver.static enumDefines the order to save things. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Cons2<Autosaver.Saveable,Throwable> Called when a save fail.protected static ApplicationListenerstatic booleanDoesn't log a message when starting/stopping theAutosaveror when running an auto save.protected static int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(Autosaver.Saveable saveable) Adds to thenormalpriority.static voidadd(Autosaver.Saveable saveable, Autosaver.SavePriority priority) static voidclear()static voidclear(Autosaver.SavePriority priority) static booleanhas(Autosaver.Saveable saveable) static booleanhas(Autosaver.Saveable saveable, Autosaver.SavePriority priority) static booleanstatic Autosaver.SavePrioritypriorityOf(Autosaver.Saveable saveable) static voidremove(Autosaver.Saveable saveable) static booleansave()Save all registered things now (only if modified).static booleanstatic intspacing()static voidspacing(int spacing) static booleanstart()Start the auto saver, will also save on application exit.static booleanstop()
-
Field Details
-
listener
-
spacing
protected static int spacing -
silent
public static boolean silentDoesn't log a message when starting/stopping theAutosaveror when running an auto save.
Errors will always be logged. -
errorHandler
Called when a save fail.
-
-
Constructor Details
-
Autosaver
public Autosaver()
-
-
Method Details
-
add
Adds to thenormalpriority. -
add
-
remove
-
clear
public static void clear() -
clear
-
has
-
has
-
priorityOf
-
saveNeeded
public static boolean saveNeeded() -
save
public static boolean save()Save all registered things now (only if modified). Errors are ignored and just printed. -
start
public static boolean start()Start the auto saver, will also save on application exit. -
stop
public static boolean stop() -
isStarted
public static boolean isStarted() -
spacing
public static int spacing() -
spacing
public static void spacing(int spacing)
-