Package adams.data
Class DataUtils
- java.lang.Object
-
- adams.data.DataUtils
-
public class DataUtils extends Object
Helper class for data-related classes.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description DataUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createFilename(File dir, DatabaseIDHandler handler, String extension)
Generates a filename for the handler.static String
createFilename(File dir, DatabaseIDHandler handler, String suffix, String extension)
Generates a filename for the handler.static String
createFilename(File dir, IDHandler handler, String extension)
Generates a filename for the handler.static String
createFilename(File dir, IDHandler handler, String suffix, String extension)
Generates a filename for the handler.static String
createFilename(File dir, Object handler, String extension)
Generates a filename for the handler.static String
createFilename(File dir, Object handler, String suffix, String extension)
Generates a filename for the handler.static String
createFilename(File dir, String name, String extension)
Generates a filename.static String
createFilename(File dir, String name, String suffix, String extension)
Generates a filename.
-
-
-
Method Detail
-
createFilename
public static String createFilename(File dir, String name, String extension)
Generates a filename.- Parameters:
dir
- the directoryname
- the name of the file (no path)extension
- the extension to add, including the dot, can be null- Returns:
- the filename
-
createFilename
public static String createFilename(File dir, String name, String suffix, String extension)
Generates a filename.- Parameters:
dir
- the directoryname
- the name of the file (no path)suffix
- an optional suffix to append before the extension, can be nullextension
- the extension to add, including the dot, can be null- Returns:
- the filename
-
createFilename
public static String createFilename(File dir, DatabaseIDHandler handler, String extension)
Generates a filename for the handler.- Parameters:
dir
- the directoryhandler
- the handler to generate the filename forextension
- the extension to add, including the dot- Returns:
- the filename
-
createFilename
public static String createFilename(File dir, DatabaseIDHandler handler, String suffix, String extension)
Generates a filename for the handler.- Parameters:
dir
- the directoryhandler
- the handler to generate the filename forsuffix
- an optional suffix to append before the extension, can be nullextension
- the extension to add, including the dot, can be null- Returns:
- the filename
-
createFilename
public static String createFilename(File dir, IDHandler handler, String extension)
Generates a filename for the handler.- Parameters:
dir
- the directoryhandler
- the handler to generate the filename forextension
- the extension to add, including the dot, can be null- Returns:
- the filename
-
createFilename
public static String createFilename(File dir, IDHandler handler, String suffix, String extension)
Generates a filename for the handler.- Parameters:
dir
- the directoryhandler
- the handler to generate the filename forsuffix
- an optional suffix to append before the extension, can be nullextension
- the extension to add, including the dot, can be null- Returns:
- the filename
-
createFilename
public static String createFilename(File dir, Object handler, String extension)
Generates a filename for the handler. Must be either an IDHandler or DatabaseIDHandler.- Parameters:
dir
- the directoryhandler
- the handler to generate the filename forextension
- the extension to add, including the dot, can be null- Returns:
- the filename or null if not implementing correct interfaces
- See Also:
IDHandler
,DatabaseIDHandler
-
createFilename
public static String createFilename(File dir, Object handler, String suffix, String extension)
Generates a filename for the handler. Must be either an IDHandler or DatabaseIDHandler.- Parameters:
dir
- the directoryhandler
- the handler to generate the filename forsuffix
- an optional suffix to append before the extension, can be nullextension
- the extension to add, including the dot, can be null- Returns:
- the filename or null if not implementing correct interfaces
- See Also:
IDHandler
,DatabaseIDHandler
-
-