View Javadoc

1   package org.lcsim.recon.tracking.trfutil;
2   
3   /**
4    *Class to encapsulate a value and an integer status.
5    * Typically used to return a value of the specified type
6    * where an error is indicated with a nonzero status.
7    * @version 1.0
8    * @author  Norman A. Graf
9    */
10  public class StatusValue
11  {
12      private int _status;
13      private Object _value;
14      /**
15       * Creates a new instance of StatusValue
16       * @param status The status of the Object value.
17       * @param value  The value Object which has this status.
18       */
19      public StatusValue(int status, Object value)
20      {
21          _status = status;
22          _value = value;
23      }
24      
25      /**
26       * Return the status for this Status-Value pair.
27       * @return the integer status.
28       */
29      public int status()
30      {
31          return _status;
32      }
33      
34      /**
35       * Return the value for this Status-Value pair.
36       * @return the Object value.
37       */
38      public Object value()
39      {
40          return _value;
41      }
42      
43      /**
44       * String representation of this object.
45       * @return a String representation of this object.
46       */    
47      public String toString()
48      {
49          return _value+" has status: "+_status;
50      }
51  }