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
ConstructorDescriptionCsvThermalSource
(String csvSep, String thermalUnitsFolderPath, FileNamingStrategy fileNamingStrategy, TypeSource typeSource) -
Method Summary
Modifier and TypeMethodDescriptionReturns a unique set ofCylindricalStorageInput
instances.getCylindricStorages
(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofCylindricalStorageInput
instances.Returns a unique set ofThermalBusInput
instances.getThermalBuses
(Set<OperatorInput> operators) Returns a set ofThermalBusInput
instances.Returns a unique set ofThermalHouseInput
instances.getThermalHouses
(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofThermalHouseInput
instances.Returns a unique set of instances of all entities implementing theThermalStorageInput
abstract class.getThermalStorages
(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a unique set of instances of all entities implementing theThermalStorageInput
abstract 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 ofThermalBusInput
instances.This set has to be unique in the sense of object uniqueness but also in the sense of
UUID
uniqueness of the providedThermalBusInput
which has to be checked manually, asAssetInput.equals(Object)
is NOT restricted on the uuid ofThermalBusInput
.- Specified by:
getThermalBuses
in interfaceThermalSource
- Returns:
- a set of object and uuid unique
ThermalBusInput
entities
-
getThermalBuses
Returns a set ofThermalBusInput
instances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedThermalBusInput
which 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 ofOperatorInput
entities, theThermalBusInput
instances 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
OperatorInput
is not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED
- Specified by:
getThermalBuses
in interfaceThermalSource
- Parameters:
operators
- a set of object and uuid uniqueOperatorInput
that should be used for the returning instances- Returns:
- a set of object and uuid unique
ThermalBusInput
entities
-
getThermalStorages
Returns a unique set of instances of all entities implementing theThermalStorageInput
abstract class.This set has to be unique in the sense of object uniqueness but also in the sense of
UUID
uniqueness of the providedThermalStorageInput
which has to be checked manually, asThermalUnitInput.equals(Object)
is NOT restricted on the uuid ofThermalStorageInput
.- Specified by:
getThermalStorages
in interfaceThermalSource
- Returns:
- a set of object and uuid unique
ThermalStorageInput
entities
-
getThermalStorages
public Set<ThermalStorageInput> getThermalStorages(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a unique set of instances of all entities implementing theThermalStorageInput
abstract class. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedThermalStorageInput
which 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 ofOperatorInput
entities, theThermalStorageInput
instances 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
ThermalBusInput
entities is not exhaustive for all availableThermalStorageInput
entities (e.g. aThermalBusInput
entity 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
OperatorInput
is not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED
- Specified by:
getThermalStorages
in interfaceThermalSource
- Parameters:
operators
- a set of object and uuid uniqueOperatorInput
that should be used for the returning instancesthermalBuses
- a set of object and uuid uniqueThermalBusInput
that should be used for the returning instances- Returns:
- a set of object and uuid unique
ThermalStorageInput
entities
-
getThermalHouses
Returns a unique set ofThermalHouseInput
instances.This set has to be unique in the sense of object uniqueness but also in the sense of
UUID
uniqueness of the providedThermalHouseInput
which has to be checked manually, asThermalHouseInput.equals(Object)
is NOT restricted on the uuid ofThermalHouseInput
.- Specified by:
getThermalHouses
in interfaceThermalSource
- Returns:
- a set of object and uuid unique
ThermalHouseInput
entities
-
getThermalHouses
public Set<ThermalHouseInput> getThermalHouses(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofThermalHouseInput
instances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedThermalHouseInput
which 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 ofOperatorInput
entities, theThermalHouseInput
instances 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
ThermalBusInput
entities is not exhaustive for all availableThermalHouseInput
entities (e.g. aThermalBusInput
entity 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
OperatorInput
is not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED
- Specified by:
getThermalHouses
in interfaceThermalSource
- Parameters:
operators
- a set of object and uuid uniqueOperatorInput
that should be used for the returning instancesthermalBuses
- a set of object and uuid uniqueThermalBusInput
that should be used for the returning instances- Returns:
- a set of object and uuid unique
ThermalHouseInput
entities
-
getCylindricStorages
Returns a unique set ofCylindricalStorageInput
instances.This set has to be unique in the sense of object uniqueness but also in the sense of
UUID
uniqueness of the providedCylindricalStorageInput
which has to be checked manually, asCylindricalStorageInput.equals(Object)
is NOT restricted on the uuid ofCylindricalStorageInput
.- Specified by:
getCylindricStorages
in interfaceThermalSource
- Returns:
- a set of object and uuid unique
CylindricalStorageInput
entities
-
getCylindricStorages
public Set<CylindricalStorageInput> getCylindricStorages(Set<OperatorInput> operators, Set<ThermalBusInput> thermalBuses) Returns a set ofCylindricalStorageInput
instances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedCylindricalStorageInput
which 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 ofOperatorInput
entities, theCylindricalStorageInput
instances 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
ThermalBusInput
entities is not exhaustive for all availableCylindricalStorageInput
entities (e.g. aThermalBusInput
entity 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
OperatorInput
is not exhaustive, the corresponding operator is set toOperatorInput.NO_OPERATOR_ASSIGNED
- Specified by:
getCylindricStorages
in interfaceThermalSource
- Parameters:
operators
- a set of object and uuid uniqueOperatorInput
that should be used for the returning instancesthermalBuses
- a set of object and uuid uniqueThermalBusInput
that should be used for the returning instances- Returns:
- a set of object and uuid unique
CylindricalStorageInput
entities
-