Data Request Broker
2-3-release

fr.gael.drb.query
Class Parameter

java.lang.Object
  extended by fr.gael.drb.query.Parameter

public class Parameter
extends Object

A parameter to be or already resolved. This class identifies a parameter that as to be resolved in query. The parameter is identified by a string which is basicaly the name of the value it should bind. The type of the parameter is specified by an integer matching exactly the types defined by the fr.gael.drb.value package. If the parameter is not resolved, the default value, if provided is used instead.


Constructor Summary
Parameter(String name, int type, Value default_value)
          Builds a parameter class
 
Method Summary
 Value getDefaultValue()
          Returns the default value of the parameter.
 String getName()
          Returns the parameter name.
 int getType()
          Returns the type of the parameter.
 Value getValue()
          Returns the value of the parameter.
protected  void setDefaultValue(Value value)
          Set the default value of the parameter.
protected  void setName(String name)
          Set the parameter name.
protected  void setType(int type)
          Set the parameter type.
 void setValue(Value value)
          Set the value of the parameter.
 String toString()
          Prints out a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(String name,
                 int type,
                 Value default_value)
Builds a parameter class

Parameters:
name - name of the parameter.
type - type of the parameter.
default_value - value of the parameter (may be null).
Method Detail

setName

protected void setName(String name)
Set the parameter name.

Parameters:
name - the name to be considered ofr the parameter.

getName

public String getName()
Returns the parameter name.

Returns:
the paremeter name.

setType

protected void setType(int type)
Set the parameter type.

Parameters:
type - the type of the parameter.

getType

public int getType()
Returns the type of the parameter. The type matches extacly the types defined in the fr.gael.drb.value package.

Returns:
the parameter type.

setDefaultValue

protected void setDefaultValue(Value value)
Set the default value of the parameter.

Parameters:
value - the default value (may be null).

getDefaultValue

public Value getDefaultValue()
Returns the default value of the parameter. The default value may be null.

Returns:
default value fror this parameter.

setValue

public void setValue(Value value)
Set the value of the parameter. This operation resolves the parameter value.

Parameters:
value - the value resolving the parameter. It shall never be null.

getValue

public Value getValue()
Returns the value of the parameter. The value may be null, meaning the parameter has not already been solved. It shall be considered has solved otherwise.

Returns:
the value of the resolved parameter.

toString

public String toString()
Prints out a parameter.

Overrides:
toString in class Object
Returns:
the explicit attributes and values of the parameters.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .