info.javelot.functionalj.reflect
Class PrimitiveParameter

java.lang.Object
  extended by info.javelot.functionalj.reflect.Parameter
      extended by info.javelot.functionalj.reflect.PrimitiveParameter
All Implemented Interfaces:
Serializable

public class PrimitiveParameter
extends Parameter

Used when a method is overloaded to accept a parameter of that primitive type and its wrapper class in the same parameter position. The PrimitiveParameter indicates that the primitive type version of the overloaded method should be used. For example:

public void setValue(int p_value);
public void setValue(Integer p_value);

In this example, to pass a parameter of type int, the following code should be used:

function.addParameter(new PrimitiveParameter(5));

Note that if the method is not overloaded in this way, it is not necessary to use the PrimitiveParameter class. Simply using the wrapper class that corresponds to the primitive type will work, as in

function.addParameter(new Integer(5));

Author:
Copyright © 2006 Frederic Daoud
See Also:
Serialized Form

Constructor Summary
PrimitiveParameter(boolean p_value)
          Constructs an object which indicates to use a primitive boolean value for a parameter of the specified class.
PrimitiveParameter(byte p_value)
          Constructs an object which indicates to use a primitive byte value for a parameter of the specified class.
PrimitiveParameter(char p_value)
          Constructs an object which indicates to use a primitive char value for a parameter of the specified class.
PrimitiveParameter(double p_value)
          Constructs an object which indicates to use a primitive double value for a parameter of the specified class.
PrimitiveParameter(float p_value)
          Constructs an object which indicates to use a primitive float value for a parameter of the specified class.
PrimitiveParameter(int p_value)
          Constructs an object which indicates to use a primitive int value for a parameter of the specified class.
PrimitiveParameter(long p_value)
          Constructs an object which indicates to use a primitive long value for a parameter of the specified class.
PrimitiveParameter(short p_value)
          Constructs an object which indicates to use a primitive short value for a parameter of the specified class.
 
Method Summary
 String toString()
          Returns a String representation of the object.
 
Methods inherited from class info.javelot.functionalj.reflect.Parameter
getParameterClass, getValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrimitiveParameter

public PrimitiveParameter(boolean p_value)
Constructs an object which indicates to use a primitive boolean value for a parameter of the specified class.

Parameters:
p_value - the primitive boolean value of the parameter.

PrimitiveParameter

public PrimitiveParameter(byte p_value)
Constructs an object which indicates to use a primitive byte value for a parameter of the specified class.

Parameters:
p_value - the primitive byte value of the parameter.

PrimitiveParameter

public PrimitiveParameter(char p_value)
Constructs an object which indicates to use a primitive char value for a parameter of the specified class.

Parameters:
p_value - the primitive char value of the parameter.

PrimitiveParameter

public PrimitiveParameter(double p_value)
Constructs an object which indicates to use a primitive double value for a parameter of the specified class.

Parameters:
p_value - the primitive double value of the parameter.

PrimitiveParameter

public PrimitiveParameter(float p_value)
Constructs an object which indicates to use a primitive float value for a parameter of the specified class.

Parameters:
p_value - the primitive float value of the parameter.

PrimitiveParameter

public PrimitiveParameter(int p_value)
Constructs an object which indicates to use a primitive int value for a parameter of the specified class.

Parameters:
p_value - the primitive int value of the parameter.

PrimitiveParameter

public PrimitiveParameter(long p_value)
Constructs an object which indicates to use a primitive long value for a parameter of the specified class.

Parameters:
p_value - the primitive long value of the parameter.

PrimitiveParameter

public PrimitiveParameter(short p_value)
Constructs an object which indicates to use a primitive short value for a parameter of the specified class.

Parameters:
p_value - the primitive short value of the parameter.
Method Detail

toString

public String toString()
Returns a String representation of the object.

Overrides:
toString in class Object
Returns:
a String representation of the object, of the format PrimitiveParameter(value).