Print

Print


Commit in lcsim/src/org/lcsim/event/base on MAIN
BaseLCRelation.java+42added 1.1
Basic implementation for the LCRelation implementation.

lcsim/src/org/lcsim/event/base
BaseLCRelation.java added at 1.1
diff -N BaseLCRelation.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ BaseLCRelation.java	13 Apr 2011 17:34:29 -0000	1.1
@@ -0,0 +1,42 @@
+package org.lcsim.event.base;
+
+import org.lcsim.event.LCRelation;
+
+/**
+ * Implementation of the LCRelation interface.
+ * 
+ * @author <a href="mailto:[log in to unmask]">Christian Grefe</a>
+ */
+public class BaseLCRelation implements LCRelation {
+
+	protected Object from;
+	protected Object to;
+	protected float weight;
+	
+	public BaseLCRelation(Object from, Object to) {
+		this(from, to, 1);
+	}
+	
+	public BaseLCRelation(Object from, Object to, double weight) {
+		this.from = from;
+		this.to = to;
+		this.weight = (float)weight;
+	}
+	
+	public Object getFrom() {
+		return from;
+	}
+	
+	public Object getTo() {
+		return to;
+	}
+	
+	public float getWeight() {
+		return weight;
+	}
+	
+	public void setWeight(double weight) {
+		this.weight = (float)weight;
+	}
+	
+}
CVSspam 0.2.8