Package mgui.interfaces.graphs
Class DefaultGraphEdge
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.graphs.AbstractGraphEdge
mgui.interfaces.graphs.DefaultGraphEdge
- All Implemented Interfaces:
WeightedGraphEdge
,InterfaceObject
,NamedObject
,TreeObject
,CleanableObject
,XMLObject
- Direct Known Subclasses:
NeuralNetConnection
public class DefaultGraphEdge extends AbstractGraphEdge implements WeightedGraphEdge
Default implementation of a Graph edge. Allows an edge weight to be specified.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType
-
Field Summary
Fields Modifier and Type Field Description protected double
weight
Fields inherited from class mgui.interfaces.graphs.AbstractGraphEdge
from, to, type
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes
-
Constructor Summary
Constructors Constructor Description DefaultGraphEdge()
DefaultGraphEdge(AbstractGraphNode from, AbstractGraphNode to)
DefaultGraphEdge(AbstractGraphNode from, AbstractGraphNode to, double weight)
DefaultGraphEdge(AbstractGraphNode from, AbstractGraphNode to, edu.uci.ics.jung.graph.util.EdgeType type)
-
Method Summary
Modifier and Type Method Description java.lang.Object
clone()
org.apache.commons.collections15.Factory<AbstractGraphEdge>
getFactory()
java.lang.String
getLabel()
double
getWeight()
static org.apache.commons.collections15.Transformer<AbstractGraphEdge,java.lang.Double>
getWeightTransformer()
java.lang.String
getXML(int tab, int v_from, int v_to)
Returns an XML representation for this edge given from and to indices.void
handleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
Handles the start of an XML element.void
setWeight(double weight)
Methods inherited from class mgui.interfaces.graphs.AbstractGraphEdge
getDTD, getFrom, getLocalName, getShortXML, getTo, getType, getXML, getXML, getXMLSchema, handleXMLElementEnd, handleXMLString, setFromEdge, setFromNodes, setLabel, setType, setVertices, writeXML, writeXML, writeXML
Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, getName, getTreeLabel, isDestroyed, issueTreeNode, setName, setTreeNode, updateTreeNodes
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
weight
protected double weight
-
-
Constructor Details
-
DefaultGraphEdge
public DefaultGraphEdge() -
DefaultGraphEdge
-
DefaultGraphEdge
public DefaultGraphEdge(AbstractGraphNode from, AbstractGraphNode to, edu.uci.ics.jung.graph.util.EdgeType type) -
DefaultGraphEdge
-
-
Method Details
-
getWeight
public double getWeight()- Specified by:
getWeight
in interfaceWeightedGraphEdge
-
clone
public java.lang.Object clone()- Overrides:
clone
in classAbstractGraphEdge
-
setWeight
public void setWeight(double weight)- Specified by:
setWeight
in interfaceWeightedGraphEdge
-
getLabel
public java.lang.String getLabel()- Overrides:
getLabel
in classAbstractGraphEdge
-
getFactory
-
handleXMLElementStart
public void handleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLObject
Handles the start of an XML element.- Specified by:
handleXMLElementStart
in interfaceXMLObject
- Overrides:
handleXMLElementStart
in classAbstractGraphEdge
- Parameters:
localName
- Local name of the elementattributes
- Set of element attributestype
- TheXMLType
of this element- Throws:
org.xml.sax.SAXException
-
getXML
public java.lang.String getXML(int tab, int v_from, int v_to)Description copied from class:AbstractGraphEdge
Returns an XML representation for this edge given from and to indices.- Overrides:
getXML
in classAbstractGraphEdge
- Returns:
-
getWeightTransformer
public static org.apache.commons.collections15.Transformer<AbstractGraphEdge,java.lang.Double> getWeightTransformer()
-