Package com.powsybl.iidm.network.impl
Class VariantManagerImpl
- java.lang.Object
-
- com.powsybl.iidm.network.impl.VariantManagerImpl
-
- All Implemented Interfaces:
VariantManager
public class VariantManagerImpl extends Object implements VariantManager
- Author:
- Geoffroy Jamgotchian
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allowVariantMultiThreadAccess(boolean allow)
Allows variants to be accessed simulaneously by different threads.void
cloneVariant(String sourceVariantId, String targetVariantId)
Create a new variant by cloning an existing one.void
cloneVariant(String sourceVariantId, String targetVariantId, boolean mayOverwrite)
Create or overwrite a variant by cloning an existing one.void
cloneVariant(String sourceVariantId, List<String> targetVariantIds)
Create a new variant by cloning an existing one.void
cloneVariant(String sourceVariantId, List<String> targetVariantIds, boolean mayOverwrite)
Create or overwrite a variant by cloning an existing one.int
getVariantArraySize()
Get the size of the variant array This size is different from the number of variants that also count unused but not released variants.String
getVariantId(int variantIndex)
Collection<String>
getVariantIds()
Get the variant id list.String
getWorkingVariantId()
Get the working variant.boolean
isVariantMultiThreadAccessAllowed()
Get the allowed multithread access state .void
removeVariant(String variantId)
Remove a variant.void
setWorkingVariant(String variantId)
Set the working variant.
-
-
-
Method Detail
-
getVariantIds
public Collection<String> getVariantIds()
Description copied from interface:VariantManager
Get the variant id list.- Specified by:
getVariantIds
in interfaceVariantManager
- Returns:
- the variant id list
-
getVariantArraySize
public int getVariantArraySize()
Get the size of the variant array This size is different from the number of variants that also count unused but not released variants.- Returns:
- the size of the variant array
-
getVariantId
public String getVariantId(int variantIndex)
-
getWorkingVariantId
public String getWorkingVariantId()
Description copied from interface:VariantManager
Get the working variant.- Specified by:
getWorkingVariantId
in interfaceVariantManager
- Returns:
- the id of the working variant
-
setWorkingVariant
public void setWorkingVariant(String variantId)
Description copied from interface:VariantManager
Set the working variant.- Specified by:
setWorkingVariant
in interfaceVariantManager
- Parameters:
variantId
- the id of the working variant
-
cloneVariant
public void cloneVariant(String sourceVariantId, String targetVariantId)
Description copied from interface:VariantManager
Create a new variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantId
- the target variant id (the one that will be created)
-
cloneVariant
public void cloneVariant(String sourceVariantId, String targetVariantId, boolean mayOverwrite)
Description copied from interface:VariantManager
Create or overwrite a variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantId
- the target variant id list (the one that will be created/overwritten)mayOverwrite
- indicates if the target can be overwritten when it already exists
-
cloneVariant
public void cloneVariant(String sourceVariantId, List<String> targetVariantIds)
Description copied from interface:VariantManager
Create a new variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantIds
- the target variant id list (the ones that will be created)
-
cloneVariant
public void cloneVariant(String sourceVariantId, List<String> targetVariantIds, boolean mayOverwrite)
Description copied from interface:VariantManager
Create or overwrite a variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantIds
- the target variant id list (the ones that will be created/overwritten)mayOverwrite
- indicates if the target can be overwritten when it already exists
-
removeVariant
public void removeVariant(String variantId)
Description copied from interface:VariantManager
Remove a variant.- Specified by:
removeVariant
in interfaceVariantManager
- Parameters:
variantId
- the id of the variant to remove
-
allowVariantMultiThreadAccess
public void allowVariantMultiThreadAccess(boolean allow)
Description copied from interface:VariantManager
Allows variants to be accessed simulaneously by different threads. When this options is activated, the working variant can have a different value for each thread.- Specified by:
allowVariantMultiThreadAccess
in interfaceVariantManager
-
isVariantMultiThreadAccessAllowed
public boolean isVariantMultiThreadAccessAllowed()
Description copied from interface:VariantManager
Get the allowed multithread access state .- Specified by:
isVariantMultiThreadAccessAllowed
in interfaceVariantManager
- Returns:
- a boolean to check if the variantManager is allowed to be accessed simulaneously by different threads.
-
-