Package com.powsybl.iidm.mergingview
Class GeneratorAdapter
- java.lang.Object
-
- com.powsybl.iidm.mergingview.GeneratorAdapter
-
- All Implemented Interfaces:
Extendable<Generator>
,Connectable<Generator>
,Generator
,Identifiable<Generator>
,Injection<Generator>
,ReactiveLimitsHolder
public class GeneratorAdapter extends Object implements Generator
- Author:
- Thomas Adam
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlias(String alias)
Add an alias to the object.void
addAlias(String alias, boolean ensureAliasUnicity)
void
addAlias(String alias, String aliasType)
Add an alias to the object.void
addAlias(String alias, String aliasType, boolean ensureAliasUnicity)
<E extends Extension<I>>
voidaddExtension(Class<? super E> type, E extension)
Add en extension to this extendable object.Set<String>
getAliases()
Get the aliases of the object.Optional<String>
getAliasFromType(String aliasType)
Get the alias of the object with a given alias type if it exists.Optional<String>
getAliasType(String alias)
Get the alias type of an alias if it exists, an empty optional otherwise.protected I
getDelegate()
EnergySource
getEnergySource()
Get the energy source.<E extends Extension<I>>
EgetExtension(Class<? super E> type)
Get an extension based on its class type.<E extends Extension<I>>
EgetExtensionByName(String name)
Get an extension based on its name.<E extends Extension<I>>
Collection<E>getExtensions()
Get all extensions associated with this extendable object..String
getId()
Get the unique identifier of the object.String
getImplementationName()
Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions inExtendable.newExtension(java.lang.Class<B>)
.protected com.powsybl.iidm.mergingview.MergingViewIndex
getIndex()
double
getMaxP()
Get the maximal active power in MW.double
getMinP()
Get the minimal active power in MW.String
getNameOrId()
Get the name of the object if it exists.MergingView
getNetwork()
Get the network associated to the object.Optional<String>
getOptionalName()
Return an optional containing the name of the object if it exists.String
getProperty(String key)
Get property associated to specified key.String
getProperty(String key, String defaultValue)
Get property associated to specified key, with default value.Set<String>
getPropertyNames()
Get properties key values.double
getRatedS()
Get the rated nominal power (apparent power rating) in MVA.ReactiveLimits
getReactiveLimits()
Get reactive limits of the generator.<L extends ReactiveLimits>
LgetReactiveLimits(Class<L> type)
Terminal
getRegulatingTerminal()
Get the terminal used for regulation.double
getTargetP()
Get the active power target in MW.double
getTargetQ()
Get the reactive power target in MVAR.double
getTargetV()
Get the voltage target in kV.Terminal
getTerminal()
Get the terminal.List<? extends Terminal>
getTerminals()
ConnectableType
getType()
Get the connectable type.boolean
hasAliases()
Return true if identifiable has aliases.boolean
hasProperty()
Check that this object has some properties.boolean
hasProperty(String key)
Check that this object has property with specified name.boolean
isFictitious()
Get the fictitious statusboolean
isVoltageRegulatorOn()
Get the voltage regulator status.<E extends Extension<I>,B extends ExtensionAdder<I,E>>
BnewExtension(Class<B> type)
Returns an extensionAdder to build and add an extension for this extendable.MinMaxReactiveLimitsAdder
newMinMaxReactiveLimits()
Get a builder to create and associate minimum and maximum reactive limits to this generator.ReactiveCapabilityCurveAdder
newReactiveCapabilityCurve()
Get a builder to create and associate a new reactive capability curve to this generator.void
remove()
Remove the equipment.void
removeAlias(String alias)
Remove an alias of the object.<E extends Extension<I>>
booleanremoveExtension(Class<E> type)
Remove an extension based on its class type.Generator
setEnergySource(EnergySource energySource)
void
setFictitious(boolean fictitious)
Set the fictitious statusGenerator
setMaxP(double maxP)
Set the maximal active power in MW.Generator
setMinP(double minP)
Set the minimal active power in MW.String
setProperty(String key, String value)
Set property value associated to specified key.Generator
setRatedS(double ratedS)
Generator
setRegulatingTerminal(Terminal regulatingTerminal)
Generator
setTargetP(double targetP)
Set the active power target in MW.Generator
setTargetQ(double targetQ)
Set the reactive power target in MVAR.Generator
setTargetV(double targetV)
Set the voltage target in kV.Generator
setVoltageRegulatorOn(boolean voltageRegulatorOn)
Set the voltage regulator status.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.powsybl.iidm.network.Connectable
getTerminals, getType, remove
-
Methods inherited from interface com.powsybl.commons.extensions.Extendable
addExtension, getExtension, getExtensionByName, getExtensions, getImplementationName, newExtension, removeExtension
-
Methods inherited from interface com.powsybl.iidm.network.Identifiable
addAlias, addAlias, addAlias, addAlias, getAliases, getAliasFromType, getAliasType, getId, getName, getNameOrId, getNetwork, getOptionalName, getProperties, getProperty, getProperty, getPropertyNames, hasAliases, hasProperty, hasProperty, isFictitious, removeAlias, setFictitious, setProperty
-
Methods inherited from interface com.powsybl.iidm.network.Injection
getTerminal
-
-
-
-
Method Detail
-
setRegulatingTerminal
public Generator setRegulatingTerminal(Terminal regulatingTerminal)
- Specified by:
setRegulatingTerminal
in interfaceGenerator
-
getRegulatingTerminal
public Terminal getRegulatingTerminal()
Description copied from interface:Generator
Get the terminal used for regulation.- Specified by:
getRegulatingTerminal
in interfaceGenerator
- Returns:
- the terminal used for regulation
-
getReactiveLimits
public ReactiveLimits getReactiveLimits()
Description copied from interface:ReactiveLimitsHolder
Get reactive limits of the generator.- Specified by:
getReactiveLimits
in interfaceReactiveLimitsHolder
-
getReactiveLimits
public <L extends ReactiveLimits> L getReactiveLimits(Class<L> type)
- Specified by:
getReactiveLimits
in interfaceReactiveLimitsHolder
-
newReactiveCapabilityCurve
public ReactiveCapabilityCurveAdder newReactiveCapabilityCurve()
Description copied from interface:ReactiveLimitsHolder
Get a builder to create and associate a new reactive capability curve to this generator.- Specified by:
newReactiveCapabilityCurve
in interfaceReactiveLimitsHolder
-
newMinMaxReactiveLimits
public MinMaxReactiveLimitsAdder newMinMaxReactiveLimits()
Description copied from interface:ReactiveLimitsHolder
Get a builder to create and associate minimum and maximum reactive limits to this generator.- Specified by:
newMinMaxReactiveLimits
in interfaceReactiveLimitsHolder
-
getEnergySource
public EnergySource getEnergySource()
Description copied from interface:Generator
Get the energy source.- Specified by:
getEnergySource
in interfaceGenerator
-
setEnergySource
public Generator setEnergySource(EnergySource energySource)
- Specified by:
setEnergySource
in interfaceGenerator
-
getMaxP
public double getMaxP()
Description copied from interface:Generator
Get the maximal active power in MW.
-
setMaxP
public Generator setMaxP(double maxP)
Description copied from interface:Generator
Set the maximal active power in MW.
-
getMinP
public double getMinP()
Description copied from interface:Generator
Get the minimal active power in MW.
-
setMinP
public Generator setMinP(double minP)
Description copied from interface:Generator
Set the minimal active power in MW.
-
isVoltageRegulatorOn
public boolean isVoltageRegulatorOn()
Description copied from interface:Generator
Get the voltage regulator status.Depends on the working variant.
- Specified by:
isVoltageRegulatorOn
in interfaceGenerator
- See Also:
VariantManager
-
setVoltageRegulatorOn
public Generator setVoltageRegulatorOn(boolean voltageRegulatorOn)
Description copied from interface:Generator
Set the voltage regulator status.Depends on the working variant.
- Specified by:
setVoltageRegulatorOn
in interfaceGenerator
- See Also:
VariantManager
-
getTargetV
public double getTargetV()
Description copied from interface:Generator
Get the voltage target in kV.Depends on the working variant.
- Specified by:
getTargetV
in interfaceGenerator
- See Also:
VariantManager
-
setTargetV
public Generator setTargetV(double targetV)
Description copied from interface:Generator
Set the voltage target in kV.Depends on the working variant.
- Specified by:
setTargetV
in interfaceGenerator
- See Also:
VariantManager
-
getTargetP
public double getTargetP()
Description copied from interface:Generator
Get the active power target in MW.Depends on the working variant.
- Specified by:
getTargetP
in interfaceGenerator
- See Also:
VariantManager
-
setTargetP
public Generator setTargetP(double targetP)
Description copied from interface:Generator
Set the active power target in MW.Depends on the working variant.
- Specified by:
setTargetP
in interfaceGenerator
- See Also:
VariantManager
-
getTargetQ
public double getTargetQ()
Description copied from interface:Generator
Get the reactive power target in MVAR.Depends on the working variant.
- Specified by:
getTargetQ
in interfaceGenerator
- See Also:
VariantManager
-
setTargetQ
public Generator setTargetQ(double targetQ)
Description copied from interface:Generator
Set the reactive power target in MVAR.Depends on the working variant.
- Specified by:
setTargetQ
in interfaceGenerator
- See Also:
VariantManager
-
getRatedS
public double getRatedS()
Description copied from interface:Generator
Get the rated nominal power (apparent power rating) in MVA.
-
getTerminal
public final Terminal getTerminal()
Description copied from interface:Injection
Get the terminal.- Specified by:
getTerminal
in interfaceInjection<I extends Injection<I>>
-
getType
public final ConnectableType getType()
Description copied from interface:Connectable
Get the connectable type.- Specified by:
getType
in interfaceConnectable<I extends Connectable<I>>
-
getTerminals
public final List<? extends Terminal> getTerminals()
- Specified by:
getTerminals
in interfaceConnectable<I extends Connectable<I>>
-
remove
public final void remove()
Description copied from interface:Connectable
Remove the equipment.- Specified by:
remove
in interfaceConnectable<I extends Connectable<I>>
-
getNetwork
public MergingView getNetwork()
Description copied from interface:Identifiable
Get the network associated to the object.- Specified by:
getNetwork
in interfaceIdentifiable<I extends Identifiable<I>>
-
getId
public String getId()
Description copied from interface:Identifiable
Get the unique identifier of the object.- Specified by:
getId
in interfaceIdentifiable<I extends Identifiable<I>>
-
getOptionalName
public Optional<String> getOptionalName()
Description copied from interface:Identifiable
Return an optional containing the name of the object if it exists. If not, return an empty optional.- Specified by:
getOptionalName
in interfaceIdentifiable<I extends Identifiable<I>>
-
getNameOrId
public String getNameOrId()
Description copied from interface:Identifiable
Get the name of the object if it exists. If not, get the unique identifier of the object.- Specified by:
getNameOrId
in interfaceIdentifiable<I extends Identifiable<I>>
-
hasProperty
public boolean hasProperty()
Description copied from interface:Identifiable
Check that this object has some properties.- Specified by:
hasProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
hasProperty
public boolean hasProperty(String key)
Description copied from interface:Identifiable
Check that this object has property with specified name.- Specified by:
hasProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
getProperty
public String getProperty(String key)
Description copied from interface:Identifiable
Get property associated to specified key.- Specified by:
getProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
getProperty
public String getProperty(String key, String defaultValue)
Description copied from interface:Identifiable
Get property associated to specified key, with default value.- Specified by:
getProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
setProperty
public String setProperty(String key, String value)
Description copied from interface:Identifiable
Set property value associated to specified key.- Specified by:
setProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
getPropertyNames
public Set<String> getPropertyNames()
Description copied from interface:Identifiable
Get properties key values.- Specified by:
getPropertyNames
in interfaceIdentifiable<I extends Identifiable<I>>
-
isFictitious
public boolean isFictitious()
Description copied from interface:Identifiable
Get the fictitious status- Specified by:
isFictitious
in interfaceIdentifiable<I extends Identifiable<I>>
-
setFictitious
public void setFictitious(boolean fictitious)
Description copied from interface:Identifiable
Set the fictitious status- Specified by:
setFictitious
in interfaceIdentifiable<I extends Identifiable<I>>
-
addExtension
public <E extends Extension<I>> void addExtension(Class<? super E> type, E extension)
Description copied from interface:Extendable
Add en extension to this extendable object.- Specified by:
addExtension
in interfaceExtendable<I extends Identifiable<I>>
- Type Parameters:
E
- the extension type- Parameters:
type
- the extension class typeextension
- the extension
-
getExtension
public <E extends Extension<I>> E getExtension(Class<? super E> type)
Description copied from interface:Extendable
Get an extension based on its class type.- Specified by:
getExtension
in interfaceExtendable<I extends Identifiable<I>>
- Type Parameters:
E
- the extension type- Parameters:
type
- the extension class type- Returns:
- the extension mapped to the class type or null if not found
-
getExtensionByName
public <E extends Extension<I>> E getExtensionByName(String name)
Description copied from interface:Extendable
Get an extension based on its name.- Specified by:
getExtensionByName
in interfaceExtendable<I extends Identifiable<I>>
- Parameters:
name
- the extension name- Returns:
- the extension mapped to the name or null if not found
-
removeExtension
public <E extends Extension<I>> boolean removeExtension(Class<E> type)
Description copied from interface:Extendable
Remove an extension based on its class type.- Specified by:
removeExtension
in interfaceExtendable<I extends Identifiable<I>>
- Type Parameters:
E
- the extension type- Parameters:
type
- the extension class type- Returns:
- true if the extension has been removed false if extension has not been found
-
getExtensions
public <E extends Extension<I>> Collection<E> getExtensions()
Description copied from interface:Extendable
Get all extensions associated with this extendable object..- Specified by:
getExtensions
in interfaceExtendable<I extends Identifiable<I>>
- Returns:
- all extensions associated to this extendable object.
-
getImplementationName
public String getImplementationName()
Description copied from interface:Extendable
Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions inExtendable.newExtension(java.lang.Class<B>)
. This is meant to be overriden by extendables when multiple implementations exist.- Specified by:
getImplementationName
in interfaceExtendable<I extends Identifiable<I>>
- Returns:
- the name
-
newExtension
public <E extends Extension<I>,B extends ExtensionAdder<I,E>> B newExtension(Class<B> type)
Description copied from interface:Extendable
Returns an extensionAdder to build and add an extension for this extendable.The extension implementation is selected at runtime based on matching the
Extendable.getImplementationName()
of this extendable to theExtensionAdderProvider.getImplementationName()
of a provider. Implementations are loaded with java'sServiceLoader
using the ExtensionAdderProvider interface.- Specified by:
newExtension
in interfaceExtendable<I extends Identifiable<I>>
- Parameters:
type
- The interface of the ExtensionAdder- Returns:
- the adder
-
getAliases
public Set<String> getAliases()
Description copied from interface:Identifiable
Get the aliases of the object.- Specified by:
getAliases
in interfaceIdentifiable<I extends Identifiable<I>>
-
getAliasFromType
public Optional<String> getAliasFromType(String aliasType)
Description copied from interface:Identifiable
Get the alias of the object with a given alias type if it exists. Else return an empty optional.- Specified by:
getAliasFromType
in interfaceIdentifiable<I extends Identifiable<I>>
-
getAliasType
public Optional<String> getAliasType(String alias)
Description copied from interface:Identifiable
Get the alias type of an alias if it exists, an empty optional otherwise. If the alias does not exist, return an empty optional.- Specified by:
getAliasType
in interfaceIdentifiable<I extends Identifiable<I>>
-
addAlias
public void addAlias(String alias)
Description copied from interface:Identifiable
Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. No alias type is associated to this alias. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw aPowsyblException
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
addAlias
public void addAlias(String alias, boolean ensureAliasUnicity)
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
addAlias
public void addAlias(String alias, String aliasType)
Description copied from interface:Identifiable
Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. This alias is associated to a given alias type. If the given alias type is null or empty, no alias type is considered associated to the alias. Only one alias can be associated to a non null given alias type for one object. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw aPowsyblException
If a given non null type already has an associated alias for this object, throw aPowsyblException
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
addAlias
public void addAlias(String alias, String aliasType, boolean ensureAliasUnicity)
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
removeAlias
public void removeAlias(String alias)
Description copied from interface:Identifiable
Remove an alias of the object. If the alias does not exist for this object, throw aPowsyblException
- Specified by:
removeAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
hasAliases
public boolean hasAliases()
Description copied from interface:Identifiable
Return true if identifiable has aliases.- Specified by:
hasAliases
in interfaceIdentifiable<I extends Identifiable<I>>
-
getDelegate
protected I getDelegate()
-
getIndex
protected com.powsybl.iidm.mergingview.MergingViewIndex getIndex()
-
-