View Javadoc

1   package org.lcsim.event.base;
2   
3   import org.lcsim.event.LCRelation;
4   
5   /**
6    * Implements a simHit to rawHit relation, to be used within DigiSim.
7    *
8    * @author Guilherme Lima
9    * @version $Id: MyLCRelation.java,v 1.1 2005/04/26 23:20:34 lima Exp $
10   */
11  public class MyLCRelation implements LCRelation
12  {
13      /** Private constructor */
14      private MyLCRelation() { }
15  
16      /** Default weight is one
17       */
18      public MyLCRelation(Object from, Object to)
19      {
20  	this(from,to,1);
21      }
22  
23      /** Full constructor
24       */
25      public MyLCRelation(Object from, Object to, float weight)
26      {
27  	this.from = from;
28  	this.to = to;
29  	this.weight = weight;
30      }
31  
32      /** Returns the 'from' object
33       */
34      public Object getFrom() {
35  	return from;
36      }
37  
38      /** Returns the 'to' object
39       */
40      public Object getTo() {
41  	return to;
42      }
43  
44      /** Returns the weight of the relation
45       */
46      public float getWeight() {
47  	return weight;
48      }
49  
50      /** Weight should be between zero and one
51       */
52      public void setWeight(float weight) {
53  	this.weight = weight;
54      }
55  
56      //=== FIELDS ===
57  
58      /** The 'from' object of the relation */
59      protected Object from;
60  
61      /** The 'to' object of the relation */
62      protected Object to;
63  
64      /** Relation weight */
65      protected float weight;
66  }