View Javadoc

1   package org.lcsim.event.base;
2   
3   import org.lcsim.event.LCRelation;
4   
5   /**
6    * Implementation of the LCRelation interface.
7    * 
8    * @author <a href="mailto:christian.grefe@cern.ch">Christian Grefe</a>
9    */
10  public class BaseLCRelation implements LCRelation {
11  
12  	protected Object from;
13  	protected Object to;
14  	protected float weight;
15  	
16  	public BaseLCRelation(Object from, Object to) {
17  		this(from, to, 1);
18  	}
19  	
20  	public BaseLCRelation(Object from, Object to, double weight) {
21  		this.from = from;
22  		this.to = to;
23  		this.weight = (float)weight;
24  	}
25  	
26  	public Object getFrom() {
27  		return from;
28  	}
29  	
30  	public Object getTo() {
31  		return to;
32  	}
33  	
34  	public float getWeight() {
35  		return weight;
36  	}
37  	
38  	public void setWeight(double weight) {
39  		this.weight = (float)weight;
40  	}
41  	
42  }