http://www.eteks.com

com.eteks.jeks
Class JeksParameter

java.lang.Object
  |
  +--com.eteks.jeks.JeksParameter
All Implemented Interfaces:
ExpressionParameter, java.io.Serializable

public class JeksParameter
extends java.lang.Object
implements ExpressionParameter

Parameters supported in computed expressions. This class uses keys of class JeksCell or JeksCellSet for parameters matching a cell or a cell set.

Since:
Jeks 1.0
Version:
1.0
Author:
Emmanuel Puybaret
See Also:
Serialized Form

Constructor Summary
JeksParameter(JeksExpressionSyntax syntax, Interpreter interpreter, javax.swing.table.TableModel tableModel)
          Creates a JeksParameter.
 
Method Summary
 java.lang.Object getParameterKey(java.lang.String parameter)
          Returns the key matching parameter or null.
 java.lang.Object getParameterValue(java.lang.Object parameterKey)
          Returns the value of the parameter matching parameterKey.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JeksParameter

public JeksParameter(JeksExpressionSyntax syntax,
                     Interpreter interpreter,
                     javax.swing.table.TableModel tableModel)
Creates a JeksParameter.
Parameters:
syntax - expression syntax used to get the syntax of cells and create the key of a cell or of a cell set.
interpreter - the interpreter used to compute the value of a cell.
tableModel - the table model used to get a stored value for a given cell key.
Method Detail

getParameterKey

public java.lang.Object getParameterKey(java.lang.String parameter)
Returns the key matching parameter or null. For a valid parameter, it returns the matching JeksCell instance if parameter is a cell or the matching JeksCellSet instance if parameter is a cell set or IllegalCellException.class if parameter is an illegal cell identifier (#REF!).
Specified by:
getParameterKey in interface ExpressionParameter
Following copied from interface: com.eteks.parser.ExpressionParameter
Parameters:
parameter - the identifier of a parameter. The identifier is already valid for the isValidIdentifier () method of the syntax used by the parser.
Returns:
null if parameter is not valid. Otherwise the key returned will be the one passed to getParameterValue () at run time. The key may be the parameter itself.

getParameterValue

public java.lang.Object getParameterValue(java.lang.Object parameterKey)
Returns the value of the parameter matching parameterKey. If parameterKey is an instance of JeksCell it returns the value of the cell, if parameterKey is an instance of JeksCellSet it returns the values of the cell set in an Object [][] array, and if parameterKey is IllegalCellException.class it throws an exception of IllegalCellException class.
Specified by:
getParameterValue in interface ExpressionParameter
Parameters:
parameterKey - a key returned by the getParameterKey () method.
Throws:
IllegalCellException - if parameterKey is IllegalCellException.class meaning the cell is invalid.

&cp; 1998-2003 eTeks - All rights reserved