Package edu.ie3.datamodel.io.naming
Class FileNamingStrategy
java.lang.Object
edu.ie3.datamodel.io.naming.FileNamingStrategy
A naming strategy, that combines an
EntityPersistenceNamingStrategy
for naming entities
and a FileHierarchy
for a folder structure.-
Constructor Summary
ConstructorDescriptionConstructor for building the file naming strategy.FileNamingStrategy
(EntityPersistenceNamingStrategy entityPersistenceNamingStrategy) Constructor for building the file naming strategy.FileNamingStrategy
(EntityPersistenceNamingStrategy entityPersistenceNamingStrategy, FileHierarchy fileHierarchy) Constructor for building the file naming strategy. -
Method Summary
Modifier and TypeMethodDescriptionextractTimeSeriesMetaInformation
(String fileName) Deprecated, for removal: This API element is subject to removal in a future version.since 3.0.Deprecated, for removal: This API element is subject to removal in a future version.since 3.0.getDirectoryPath
(Class<? extends UniqueEntity> cls) Returns the sub directory structure with regard to some (not explicitly specified) base directory.<T extends TimeSeries<E,
V>, E extends TimeSeriesEntry<V>, V extends Value>
Optional<String>getDirectoryPath
(T timeSeries) Returns the sub directory structure with regard to some (not explicitly specified) base directory.getEntityName
(Class<? extends UniqueEntity> cls) Returns the name of the entity, that should be used for persistence.<T extends TimeSeries<E,
V>, E extends TimeSeriesEntry<V>, V extends Value>
Optional<String>getEntityName
(T timeSeries) Builds a file name (and only the file name without any directories and extension) of the given information.getFilePath
(Class<? extends UniqueEntity> cls) Get the full path to the file with regard to some (not explicitly specified) base directory.<T extends TimeSeries<E,
V>, E extends TimeSeriesEntry<V>, V extends Value>
Optional<String>getFilePath
(T timeSeries) Get the full path to the file with regard to some (not explicitly specified) base directory.Get the entity name for coordinatesGet the full path to the id coordinate file with regard to some (not explicitly specified) base directory.Returns the pattern to identify individual time series in this instance of the file naming strategy considering theEntityPersistenceNamingStrategy
andFileHierarchy
.Returns the pattern to identify load profile time series in this instance of the file naming strategy considering theEntityPersistenceNamingStrategy
andFileHierarchy
.individualTimeSeriesMetaInformation
(String fileName) static String
removeFileNameEnding
(String fileName) timeSeriesMetaInformation
(String fileName) Extracts meta information from a file name, of a time series.Extracts meta information from a file name, of a time series.
-
Constructor Details
-
FileNamingStrategy
public FileNamingStrategy(EntityPersistenceNamingStrategy entityPersistenceNamingStrategy, FileHierarchy fileHierarchy) Constructor for building the file naming strategy.- Parameters:
entityPersistenceNamingStrategy
- entity naming strategyfileHierarchy
- directory hierarchy
-
FileNamingStrategy
Constructor for building the file naming strategy. Since no directory hierarchy is provided, a flat directory hierarchy is used.- Parameters:
entityPersistenceNamingStrategy
- entity naming strategy
-
FileNamingStrategy
public FileNamingStrategy()Constructor for building the file naming strategy. Since no entity naming strategy is provided, the entity naming strategy is used. Since no directory hierarchy is provided, a flat directory hierarchy is used.
-
-
Method Details
-
getFilePath
Get the full path to the file with regard to some (not explicitly specified) base directory. The path does NOT start or end with any of the known file separators or file extension.- Parameters:
cls
- Targeted class of the given file- Returns:
- An optional sub path to the actual file
-
getFilePath
public <T extends TimeSeries<E,V>, Optional<String> getFilePathE extends TimeSeriesEntry<V>, V extends Value> (T timeSeries) Get the full path to the file with regard to some (not explicitly specified) base directory. The path does NOT start or end with any of the known file separators or file extension.- Type Parameters:
T
- Type of the time seriesE
- Type of the entry in the time seriesV
- Type of the value, that is carried by the time series entry- Parameters:
timeSeries
- Time series to derive naming information from- Returns:
- An optional sub path to the actual file
-
getDirectoryPath
Returns the sub directory structure with regard to some (not explicitly specified) base directory. The path does NOT start or end with any of the known file separators.- Parameters:
cls
- Targeted class of the given file- Returns:
- An optional sub directory path
-
getDirectoryPath
public <T extends TimeSeries<E,V>, Optional<String> getDirectoryPathE extends TimeSeriesEntry<V>, V extends Value> (T timeSeries) Returns the sub directory structure with regard to some (not explicitly specified) base directory. The path does NOT start or end with any of the known file separators.- Type Parameters:
T
- Type of the time seriesE
- Type of the entry in the time seriesV
- Type of the value, that is carried by the time series entry- Parameters:
timeSeries
- Time series to derive naming information from- Returns:
- An optional sub directory path
-
getIndividualTimeSeriesPattern
Returns the pattern to identify individual time series in this instance of the file naming strategy considering theEntityPersistenceNamingStrategy
andFileHierarchy
.- Returns:
- An individual time series pattern
-
getLoadProfileTimeSeriesPattern
Returns the pattern to identify load profile time series in this instance of the file naming strategy considering theEntityPersistenceNamingStrategy
andFileHierarchy
.- Returns:
- A load profile time series pattern
-
extractTimeSeriesMetaInformation
@Deprecated(since="3.0", forRemoval=true) public FileNameMetaInformation extractTimeSeriesMetaInformation(Path path) Deprecated, for removal: This API element is subject to removal in a future version.since 3.0. UsetimeSeriesMetaInformation(Path)
instead.Extracts meta information from a file name, of a time series.- Parameters:
path
- Path to the file- Returns:
- The meeting meta information
-
timeSeriesMetaInformation
Extracts meta information from a file name, of a time series.- Parameters:
path
- Path to the file- Returns:
- The meeting meta information
-
extractTimeSeriesMetaInformation
@Deprecated(since="3.0", forRemoval=true) public FileNameMetaInformation extractTimeSeriesMetaInformation(String fileName) Deprecated, for removal: This API element is subject to removal in a future version.since 3.0. UsetimeSeriesMetaInformation(String)
instead.Extracts meta information from a file name, of a time series. Here, a file name without leading path has to be provided- Parameters:
fileName
- File name- Returns:
- The meeting meta information
-
timeSeriesMetaInformation
Extracts meta information from a file name, of a time series. Here, a file name without leading path has to be provided- Parameters:
fileName
- File name- Returns:
- The meeting meta information
-
individualTimeSeriesMetaInformation
-
removeFileNameEnding
-
getIdCoordinateEntityName
Get the entity name for coordinates- Returns:
- the entity name string
-
getIdCoordinateFilePath
Get the full path to the id coordinate file with regard to some (not explicitly specified) base directory. The path does NOT start or end with any of the known file separators or file extension.- Returns:
- An optional sub path to the id coordinate file
-
getEntityName
Returns the name of the entity, that should be used for persistence.- Parameters:
cls
- Targeted class of the given file- Returns:
- The name of the entity
-
getEntityName
public <T extends TimeSeries<E,V>, Optional<String> getEntityNameE extends TimeSeriesEntry<V>, V extends Value> (T timeSeries) Builds a file name (and only the file name without any directories and extension) of the given information.- Type Parameters:
T
- Type of the time seriesE
- Type of the entry in the time seriesV
- Type of the value, that is carried by the time series entry- Parameters:
timeSeries
- Time series to derive naming information from- Returns:
- A file name for this particular time series
-