Class CsvThermalSource
- All Implemented Interfaces:
DataSource,ThermalSource
AssetInput entities from .csv files
This source is not buffered which means each call on a getter method always tries to read all data is necessary to return the requested objects in a hierarchical cascading way.
If performance is an issue, it is recommended to read the data cascading starting with reading nodes and then using the getters with arguments to avoid reading the same data multiple times.
The resulting sets are always unique on object and UUID base (with distinct UUIDs).
- Since:
- 03.04.20
-
Field Summary
Fields inherited from class edu.ie3.datamodel.io.source.csv.CsvDataSource
connector, csvSep, FIELDS_TO_VALUES_MAP, log, NODE, NODE_A, NODE_B, OPERATOR, TYPE -
Constructor Summary
ConstructorsConstructorDescriptionCsvThermalSource(String csvSep, String thermalUnitsFolderPath, FileNamingStrategy fileNamingStrategy, TypeSource typeSource) -
Method Summary
Modifier and TypeMethodDescriptionReturns a unique set ofCylindricalStorageInputinstances.getCylindricStorages(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofCylindricalStorageInputinstances.Returns a unique set ofThermalBusInputinstances.getThermalBuses(Set<OperatorInput> operators) Returns a set ofThermalBusInputinstances.Returns a unique set ofThermalHouseInputinstances.getThermalHouses(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofThermalHouseInputinstances.Returns a unique set of instances of all entities implementing theThermalStorageInputabstract class.getThermalStorages(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a unique set of instances of all entities implementing theThermalStorageInputabstract class.Methods inherited from class edu.ie3.datamodel.io.source.csv.CsvDataSource
assetInputEntityDataStream, assetInputEntityDataStream, buildStreamWithFieldsToAttributesMap, buildStreamWithFieldsToAttributesMap, csvRowFieldValueMapping, distinctRowsWithLog, findFirstEntityByUuid, getAssetType, isPresentCollectIfNot, logSkippingWarning, nodeAssetEntityStream, nodeAssetInputEntityDataStream, parseCsvRow, printInvalidElementInformation, saveMapGet, simpleEntityDataStream
-
Constructor Details
-
CsvThermalSource
public CsvThermalSource(String csvSep, String thermalUnitsFolderPath, FileNamingStrategy fileNamingStrategy, TypeSource typeSource)
-
-
Method Details
-
getThermalBuses
Returns a unique set ofThermalBusInputinstances.This set has to be unique in the sense of object uniqueness but also in the sense of
UUIDuniqueness of the providedThermalBusInputwhich has to be checked manually, asAssetInput.equals(Object)is NOT restricted on the uuid ofThermalBusInput.- Specified by:
getThermalBusesin interfaceThermalSource- Returns:
- a set of object and uuid unique
ThermalBusInputentities
-
getThermalBuses
Returns a set ofThermalBusInputinstances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedThermalBusInputwhich has to be checked manually, asAssetInput.equals(Object)is NOT restricted on the uuid ofThermalBusInput.In contrast to
ThermalSource.getThermalBuses()this interface provides the ability to pass in an already existing set ofOperatorInputentities, theThermalBusInputinstances depend on. Doing so, already loaded nodes can be recycled to improve performance and prevent unnecessary loading operations.If something fails during the creation process it's up to the concrete implementation of an empty set or a set with all entities that has been able to be build is returned.
If the set with
OperatorInputis not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED- Specified by:
getThermalBusesin interfaceThermalSource- Parameters:
operators- a set of object and uuid uniqueOperatorInputthat should be used for the returning instances- Returns:
- a set of object and uuid unique
ThermalBusInputentities
-
getThermalStorages
Returns a unique set of instances of all entities implementing theThermalStorageInputabstract class.This set has to be unique in the sense of object uniqueness but also in the sense of
UUIDuniqueness of the providedThermalStorageInputwhich has to be checked manually, asThermalUnitInput.equals(Object)is NOT restricted on the uuid ofThermalStorageInput.- Specified by:
getThermalStoragesin interfaceThermalSource- Returns:
- a set of object and uuid unique
ThermalStorageInputentities
-
getThermalStorages
public Set<ThermalStorageInput> getThermalStorages(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a unique set of instances of all entities implementing theThermalStorageInputabstract class. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedThermalStorageInputwhich has to be checked manually, asThermalUnitInput.equals(Object)is NOT restricted on the uuid ofThermalStorageInput.In contrast to
ThermalSource.getThermalStorages()this interface provides the ability to pass in an already existing set ofOperatorInputentities, theThermalStorageInputinstances depend on. Doing so, already loaded nodes can be recycled to improve performance and prevent unnecessary loading operations.If something fails during the creation process it's up to the concrete implementation of an empty set or a set with all entities that has been able to be build is returned.
If the set of
ThermalBusInputentities is not exhaustive for all availableThermalStorageInputentities (e.g. aThermalBusInputentity is missing) or if an error during the building process occurs, the entity that misses something will be skipped (which can be seen as a filtering functionality) but all entities that are able to be built will be returned anyway and the elements that couldn't have been built are logged.If the set with
OperatorInputis not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED- Specified by:
getThermalStoragesin interfaceThermalSource- Parameters:
operators- a set of object and uuid uniqueOperatorInputthat should be used for the returning instancesthermalBuses- a set of object and uuid uniqueThermalBusInputthat should be used for the returning instances- Returns:
- a set of object and uuid unique
ThermalStorageInputentities
-
getThermalHouses
Returns a unique set ofThermalHouseInputinstances.This set has to be unique in the sense of object uniqueness but also in the sense of
UUIDuniqueness of the providedThermalHouseInputwhich has to be checked manually, asThermalHouseInput.equals(Object)is NOT restricted on the uuid ofThermalHouseInput.- Specified by:
getThermalHousesin interfaceThermalSource- Returns:
- a set of object and uuid unique
ThermalHouseInputentities
-
getThermalHouses
public Set<ThermalHouseInput> getThermalHouses(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofThermalHouseInputinstances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedThermalHouseInputwhich has to be checked manually, asThermalHouseInput.equals(Object)is NOT restricted on the uuid ofThermalHouseInput.In contrast to
ThermalSource.getThermalHouses()this interface provides the ability to pass in an already existing set ofOperatorInputentities, theThermalHouseInputinstances depend on. Doing so, already loaded nodes can be recycled to improve performance and prevent unnecessary loading operations.If something fails during the creation process it's up to the concrete implementation of an empty set or a set with all entities that has been able to be build is returned.
If the set of
ThermalBusInputentities is not exhaustive for all availableThermalHouseInputentities (e.g. aThermalBusInputentity is missing) or if an error during the building process occurs, the entity that misses something will be skipped (which can be seen as a filtering functionality) but all entities that are able to be built will be returned anyway and the elements that couldn't have been built are logged.If the set with
OperatorInputis not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED- Specified by:
getThermalHousesin interfaceThermalSource- Parameters:
operators- a set of object and uuid uniqueOperatorInputthat should be used for the returning instancesthermalBuses- a set of object and uuid uniqueThermalBusInputthat should be used for the returning instances- Returns:
- a set of object and uuid unique
ThermalHouseInputentities
-
getCylindricStorages
Returns a unique set ofCylindricalStorageInputinstances.This set has to be unique in the sense of object uniqueness but also in the sense of
UUIDuniqueness of the providedCylindricalStorageInputwhich has to be checked manually, asCylindricalStorageInput.equals(Object)is NOT restricted on the uuid ofCylindricalStorageInput.- Specified by:
getCylindricStoragesin interfaceThermalSource- Returns:
- a set of object and uuid unique
CylindricalStorageInputentities
-
getCylindricStorages
public Set<CylindricalStorageInput> getCylindricStorages(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofCylindricalStorageInputinstances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedCylindricalStorageInputwhich has to be checked manually, asCylindricalStorageInput.equals(Object)is NOT restricted on the uuid ofCylindricalStorageInput.In contrast to
ThermalSource.getCylindricStorages()this interface provides the ability to pass in an already existing set ofOperatorInputentities, theCylindricalStorageInputinstances depend on. Doing so, already loaded nodes can be recycled to improve performance and prevent unnecessary loading operations.If something fails during the creation process it's up to the concrete implementation of an empty set or a set with all entities that has been able to be build is returned.
If the set of
ThermalBusInputentities is not exhaustive for all availableCylindricalStorageInputentities (e.g. aThermalBusInputentity is missing) or if an error during the building process occurs, the entity that misses something will be skipped (which can be seen as a filtering functionality) but all entities that are able to be built will be returned anyway and the elements that couldn't have been built are logged.If the set with
OperatorInputis not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED- Specified by:
getCylindricStoragesin interfaceThermalSource- Parameters:
operators- a set of object and uuid uniqueOperatorInputthat should be used for the returning instancesthermalBuses- a set of object and uuid uniqueThermalBusInputthat should be used for the returning instances- Returns:
- a set of object and uuid unique
CylindricalStorageInputentities
-