Package repast.simphony.data2.util
Class DataUtilities
- java.lang.Object
-
- repast.simphony.data2.util.DataUtilities
-
public class DataUtilities extends Object
Static util methods for working with DataSetDescriptors etc.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description DataUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<DataSetDescriptor>
getDataSetDescriptors(ControllerRegistry reg, Object contextId)
Gets a list of the data set descriptors defined for the specified context.static boolean
isNumeric(Class<?> dataType)
static boolean
isNumeric(CustomDataSourceDefinition def)
Gets whether or not the specified data sources produces numeric data.static boolean
isNumeric(MethodDataSourceDefinition def)
Gets whether or not the specified data sources produces numeric data.static void
renameFileIfExists(String filename)
Rename any existing file with the specified filename.
-
-
-
Method Detail
-
getDataSetDescriptors
public static List<DataSetDescriptor> getDataSetDescriptors(ControllerRegistry reg, Object contextId)
Gets a list of the data set descriptors defined for the specified context.- Parameters:
reg
-contextId
-- Returns:
-
isNumeric
public static boolean isNumeric(CustomDataSourceDefinition def) throws ClassNotFoundException, InstantiationException, IllegalAccessException
Gets whether or not the specified data sources produces numeric data.- Parameters:
def
-- Returns:
- true if the data source produces numeric data, otherwise false.
- Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
-
isNumeric
public static boolean isNumeric(Class<?> dataType)
-
isNumeric
public static boolean isNumeric(MethodDataSourceDefinition def) throws ClassNotFoundException
Gets whether or not the specified data sources produces numeric data.- Parameters:
def
-- Returns:
- true if the data source produces numeric data, otherwise false.
- Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
-
renameFileIfExists
public static void renameFileIfExists(String filename)
Rename any existing file with the specified filename. This will append an incremented number to the filename until it won't clobber any existing files.- Parameters:
filename
- the filename to rename if it exists
-
-