Package com.powsybl.iidm.mergingview
Class BusbarSectionAdapter
- java.lang.Object
-
- com.powsybl.iidm.mergingview.BusbarSectionAdapter
-
- All Implemented Interfaces:
Extendable<BusbarSection>
,BusbarSection
,Connectable<BusbarSection>
,Identifiable<BusbarSection>
,Injection<BusbarSection>
public class BusbarSectionAdapter extends Object implements BusbarSection
- 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.double
getAngle()
protected I
getDelegate()
<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()
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.Terminal
getTerminal()
Get the terminal.List<? extends Terminal>
getTerminals()
IdentifiableType
getType()
Get identifiable type.double
getV()
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 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.void
remove(boolean removeDanglingSwitches)
Remove the connectable from the voltage level.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.boolean
removeProperty(String key)
Remove property with specified key.void
setFictitious(boolean fictitious)
Set the fictitious statusString
setProperty(String key, String value)
Set property value associated to specified key.-
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.BusbarSection
getType
-
Methods inherited from interface com.powsybl.iidm.network.Connectable
getTerminals, remove, 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, removeProperty, setFictitious, setProperty
-
Methods inherited from interface com.powsybl.iidm.network.Injection
getTerminal
-
-
-
-
Method Detail
-
getV
public double getV()
- Specified by:
getV
in interfaceBusbarSection
-
getAngle
public double getAngle()
- Specified by:
getAngle
in interfaceBusbarSection
-
getTerminal
public final Terminal getTerminal()
Description copied from interface:Injection
Get the terminal.- Specified by:
getTerminal
in interfaceInjection<I extends Injection<I>>
-
getTerminals
public final List<? extends Terminal> getTerminals()
- Specified by:
getTerminals
in interfaceConnectable<I extends Connectable<I>>
-
remove
public final void remove(boolean removeDanglingSwitches)
Description copied from interface:Connectable
Remove the connectable from the voltage level.- Specified by:
remove
in interfaceConnectable<I extends Connectable<I>>
- Parameters:
removeDanglingSwitches
- if true, also remove dangling switches in addition to isolated nodes
-
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>>
-
removeProperty
public boolean removeProperty(String key)
Description copied from interface:Identifiable
Remove property with specified key.- Specified by:
removeProperty
in interfaceIdentifiable<I extends Identifiable<I>>
- Parameters:
key
- the property key- Returns:
true
if property exists and has been removed,false
otherwise
-
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>>
-
getType
public IdentifiableType getType()
Description copied from interface:Identifiable
Get identifiable type.- Specified by:
getType
in interfaceIdentifiable<I extends Identifiable<I>>
- Returns:
- the identifiable type
-
getDelegate
protected I getDelegate()
-
getIndex
protected com.powsybl.iidm.mergingview.MergingViewIndex getIndex()
-
-