Author: koen.aers(a)jboss.com
Date: 2009-04-22 19:28:59 -0400 (Wed, 22 Apr 2009)
New Revision: 14855
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
Log:
create DefaultElement and move the metadata getters/setters to that class
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java 2009-04-22
17:37:11 UTC (rev 14854)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java 2009-04-22
23:28:59 UTC (rev 14855)
@@ -1,10 +1,8 @@
package org.jboss.tools.flow.common.model;
-import java.util.HashMap;
-public class DefaultConnection implements Connection {
+public class DefaultConnection extends DefaultElement implements Connection {
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
private Node from, to;
public DefaultConnection() {
@@ -16,14 +14,6 @@
setTo(to);
}
- public Object getMetaData(String key) {
- return metaData.get(key);
- }
-
- public void setMetaData(String key, Object value) {
- metaData.put(key, value);
- }
-
public Node getFrom() {
return from;
}
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java 2009-04-22
23:28:59 UTC (rev 14855)
@@ -0,0 +1,17 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.HashMap;
+
+public class DefaultElement implements Element {
+
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+}
Property changes on:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java 2009-04-22
17:37:11 UTC (rev 14854)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java 2009-04-22
23:28:59 UTC (rev 14855)
@@ -4,7 +4,7 @@
import java.util.HashMap;
import java.util.List;
-public class DefaultFlow implements Flow {
+public class DefaultFlow extends DefaultElement implements Flow {
private String name;
private HashMap<String, Object> metaData = new HashMap<String, Object>();
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java 2009-04-22
17:37:11 UTC (rev 14854)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java 2009-04-22
23:28:59 UTC (rev 14855)
@@ -5,14 +5,12 @@
import java.util.List;
import java.util.Map;
-public class DefaultNode implements Node {
+public class DefaultNode extends DefaultElement implements Node {
private long id;
private String name;
private Container container;
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
-
private List<Connection> incomingConnections = new ArrayList<Connection>();
private List<Connection> outgoingConnections = new ArrayList<Connection>();
@@ -32,14 +30,6 @@
this.name = name;
}
- public void setMetaData(String key, Object value) {
- metaData.put(key, value);
- }
-
- public Object getMetaData(String key) {
- return metaData.get(key);
- }
-
public Container getNodeContainer() {
return container;
}
Show replies by date