View Javadoc

1   /*
2    * $Id: AbstractParameterAdapter.java,v 1.2 2004/11/27 13:20:02 pah Exp $
3    * 
4    * Created on 27-Oct-2004 by Paul Harrison (pah@jb.man.ac.uk)
5    * Copyright 2004 AstroGrid. All rights reserved.
6    *
7    * This software is published under the terms of the AstroGrid 
8    * Software License version 1.2, a copy of which has been included 
9    * with this distribution in the LICENSE.txt file.  
10   *
11   */ 
12  
13  package org.astrogrid.applications.parameter;
14  
15  import org.astrogrid.applications.CeaException;
16  import org.astrogrid.applications.beans.v1.parameters.ParameterValue;
17  import org.astrogrid.applications.description.ParameterDescription;
18  import org.astrogrid.applications.parameter.protocol.ExternalValue;
19  
20  /***
21   * Base class for {@link org.astrogrid.applications.parameter.ParameterAdapter}. It contains the necessary fileds that the adapter wraps. 
22   * @author Paul Harrison (pah@jb.man.ac.uk) 27-Oct-2004
23   * @version $Name: HEAD $
24   * @since iteration6
25   */
26  public abstract class AbstractParameterAdapter implements ParameterAdapter {
27     /*** Construct a new AbstractParameterAdapter
28      * @param val the parameter value to adapt.
29      * @param description the description associated with this value.
30      * @param externalVal wrapper around the external location that contains the true value of the parameter (in case of direct parameters, is null) 
31      */
32     public AbstractParameterAdapter(ParameterValue val,ParameterDescription description,ExternalValue externalVal) {
33         this.val = val;
34         this.description = description;
35         this.externalVal = externalVal;
36     }
37  
38     /* (non-Javadoc)
39      * @see org.astrogrid.applications.parameter.ParameterAdapter#process()
40      */
41     public abstract Object process() throws CeaException;
42     /* (non-Javadoc)
43      * @see org.astrogrid.applications.parameter.ParameterAdapter#writeBack(java.lang.Object)
44      */
45     public abstract void writeBack(Object o) throws CeaException ;
46     /*** the parameter value */
47     protected final ParameterValue val;
48     /*** the parameter descritpion */
49     protected final ParameterDescription description;
50     /*** indirection to the external location containing the true value of an indirect parameter */
51     protected final ExternalValue externalVal;
52     
53     public ParameterValue getWrappedParameter() {
54          return val;
55      }
56  
57   
58  
59  }