Package com.powsybl.sld.model.nodes
Class AbstractNode
- java.lang.Object
-
- com.powsybl.sld.model.nodes.AbstractNode
-
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
ConnectivityNode
,EquipmentNode
public abstract class AbstractNode extends Object implements Node
- Author:
- Benoit Jeanson
, Nicolas Duchene, Geoffroy Jamgotchian , Franck Lecuyer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.powsybl.sld.model.nodes.Node
Node.NodeType
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractNode(Node.NodeType type, String id, String componentType, boolean fictitious)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdjacentEdge(Edge e)
boolean
checkNodeSimilarity(Node n)
Check similarity with another nodeprotected Orientation
defaultOrientation()
List<Edge>
getAdjacentEdges()
List<Node>
getAdjacentNodes()
int
getCardinality(VoltageLevelGraph vlGraph)
String
getComponentType()
Point
getCoordinates()
Direction
getDirection()
String
getId()
Optional<String>
getLabel()
Optional<Integer>
getOrder()
Orientation
getOrientation()
Node.NodeType
getType()
double
getX()
Get abscissa within current voltage leveldouble
getY()
Get ordinate within current voltage levelboolean
isFictitious()
void
removeAdjacentEdge(Edge e)
void
removeOrder()
void
setCoordinates(double x, double y)
void
setCoordinates(Point coord)
void
setDirection(Direction direction)
void
setLabel(String label)
void
setOrder(int order)
void
setOrientation(Orientation orientation)
void
setType(Node.NodeType type)
void
setX(double x)
void
setY(double y)
boolean
similarToAFeederNode(Node n)
String
toString()
void
writeJson(com.fasterxml.jackson.core.JsonGenerator generator, boolean includeCoordinates)
protected void
writeJsonContent(com.fasterxml.jackson.core.JsonGenerator generator, boolean includeCoordinates)
-
-
-
Constructor Detail
-
AbstractNode
protected AbstractNode(Node.NodeType type, String id, String componentType, boolean fictitious)
Constructor
-
-
Method Detail
-
getComponentType
public String getComponentType()
- Specified by:
getComponentType
in interfaceNode
-
isFictitious
public boolean isFictitious()
- Specified by:
isFictitious
in interfaceNode
-
setType
public void setType(Node.NodeType type)
-
getAdjacentNodes
public List<Node> getAdjacentNodes()
- Specified by:
getAdjacentNodes
in interfaceNode
-
getAdjacentEdges
public List<Edge> getAdjacentEdges()
- Specified by:
getAdjacentEdges
in interfaceNode
-
addAdjacentEdge
public void addAdjacentEdge(Edge e)
- Specified by:
addAdjacentEdge
in interfaceNode
-
removeAdjacentEdge
public void removeAdjacentEdge(Edge e)
- Specified by:
removeAdjacentEdge
in interfaceNode
-
getCoordinates
public Point getCoordinates()
- Specified by:
getCoordinates
in interfaceNode
-
setCoordinates
public void setCoordinates(Point coord)
- Specified by:
setCoordinates
in interfaceNode
-
setCoordinates
public void setCoordinates(double x, double y)
- Specified by:
setCoordinates
in interfaceNode
-
getX
public double getX()
Get abscissa within current voltage level
-
getY
public double getY()
Get ordinate within current voltage level
-
getType
public Node.NodeType getType()
-
removeOrder
public void removeOrder()
- Specified by:
removeOrder
in interfaceNode
-
getDirection
public Direction getDirection()
- Specified by:
getDirection
in interfaceNode
-
setDirection
public void setDirection(Direction direction)
- Specified by:
setDirection
in interfaceNode
-
getOrientation
public Orientation getOrientation()
- Specified by:
getOrientation
in interfaceNode
-
setOrientation
public void setOrientation(Orientation orientation)
- Specified by:
setOrientation
in interfaceNode
-
defaultOrientation
protected Orientation defaultOrientation()
-
checkNodeSimilarity
public boolean checkNodeSimilarity(Node n)
Check similarity with another node- Specified by:
checkNodeSimilarity
in interfaceNode
- Parameters:
n
- the node to compare with- Returns:
- true IF the both are the same OR they are both Busbar OR they are both EQ(but not Busbar); false otherwise
-
similarToAFeederNode
public boolean similarToAFeederNode(Node n)
- Specified by:
similarToAFeederNode
in interfaceNode
-
getCardinality
public int getCardinality(VoltageLevelGraph vlGraph)
- Specified by:
getCardinality
in interfaceNode
-
writeJsonContent
protected void writeJsonContent(com.fasterxml.jackson.core.JsonGenerator generator, boolean includeCoordinates) throws IOException
- Throws:
IOException
-
writeJson
public void writeJson(com.fasterxml.jackson.core.JsonGenerator generator, boolean includeCoordinates) throws IOException
- Specified by:
writeJson
in interfaceNode
- Throws:
IOException
-
-