medusa.graph
Class BasicEdge
- java.lang.Object
-
- medusa.graph.BasicEdge
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- Edge, UniqueEdge
public abstract class BasicEdge extends java.lang.Object implements java.io.SerializableBasic representation of an Edge as a connection between two nodes. Note that a node will only exist if there is an edge between them. This Graph representation is not based on nodes but edges.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.Stringn1Node 1java.lang.Stringn2Node 2
-
Constructor Summary
Constructors Constructor and Description BasicEdge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancontains(java.lang.String lbl)Checks ifNoden is in the edgejava.lang.StringgetFromName()Name of the first nodejava.lang.String[]getNodes()Node 1java.lang.StringgetToName()Name of the second nodebooleanoppositeName(java.lang.Object o)Check if edge if opposite to another edge, i.e if edge a contains nodes (n1,n2) and edge b contains (n2,n1)/java.lang.Stringreport()Quick report of the two nodesbooleansameName(java.lang.Object o)Check if two edges have the same nodes
-
-
-
Method Detail
-
getFromName
public java.lang.String getFromName()
Name of the first node- Returns:
- String name
-
getToName
public java.lang.String getToName()
Name of the second node- Returns:
- String name
-
report
public java.lang.String report()
Quick report of the two nodes- Returns:
- String
-
sameName
public boolean sameName(java.lang.Object o)
Check if two edges have the same nodes- Parameters:
o-Objectrepresentation ofBasicEdge- Returns:
Trueif same nodes occur in the two edges
-
contains
public boolean contains(java.lang.String lbl)
Checks ifNoden is in the edge- Parameters:
lbl- label of node- Returns:
- True if edge contains the label
-
oppositeName
public boolean oppositeName(java.lang.Object o)
Check if edge if opposite to another edge, i.e if edge a contains nodes (n1,n2) and edge b contains (n2,n1)/- Parameters:
o-BasicEdgecast asObject- Returns:
Trueif oppposites
-
getNodes
public java.lang.String[] getNodes()
Node 1- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG