From 254ee6f47eebfc00462c10756a92066e82cc1a96 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 21 Jun 2011 15:46:02 +0200 Subject: Initial commit --- source/com/c2kernel/graph/model/GraphableEdge.java | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 source/com/c2kernel/graph/model/GraphableEdge.java (limited to 'source/com/c2kernel/graph/model/GraphableEdge.java') diff --git a/source/com/c2kernel/graph/model/GraphableEdge.java b/source/com/c2kernel/graph/model/GraphableEdge.java new file mode 100755 index 0000000..a6d9a63 --- /dev/null +++ b/source/com/c2kernel/graph/model/GraphableEdge.java @@ -0,0 +1,71 @@ +package com.c2kernel.graph.model; + +import com.c2kernel.utils.CastorHashMap; +import com.c2kernel.utils.KeyValuePair; + +/** +* @version $Revision: 1.2 $ $Date: 2003/05/12 13:10:20 $ +* @author $Author: abranson $ +*/ +public abstract class GraphableEdge extends DirectedEdge +{ + + private GraphableVertex mParent; + private CastorHashMap mProperties = null; + + public GraphableEdge() + { + mProperties = new CastorHashMap(); + } + + public GraphableEdge(GraphableVertex pre, GraphableVertex nex) + { + mProperties = new CastorHashMap(); + setParent(pre.getParent()); + pre.getParent().getChildrenGraphModel().addEdgeAndCreateId(this, pre, nex); + } + + /** + * Returns the parent. + * @return GraphableVertex + */ + public GraphableVertex getParent() + { + return mParent; + } + + /** + * Sets the parent. + * @param parent The parent to set + */ + public void setParent(GraphableVertex parent) + { + mParent = parent; + } + + /** + * Returns the properties. + * @return CastorHashMap + */ + public CastorHashMap getProperties() + { + return mProperties; + } + + /** + * Sets the properties. + * @param properties The properties to set + */ + public void setProperties(CastorHashMap properties) + { + mProperties = properties; + } + + public KeyValuePair[] getKeyValuePairs() { + return mProperties.getKeyValuePairs(); + } + + public void setKeyValuePairs(KeyValuePair[] pairs) { + mProperties.setKeyValuePairs(pairs); + } +} -- cgit v1.2.3