org.objectweb.medor.eval.lib
Class TuplePNameGetter

java.lang.Object
  extended byorg.objectweb.medor.eval.lib.TuplePNameGetter

public class TuplePNameGetter
extends java.lang.Object

This class implements a JORM PnameGetter. It relies on a Tuple, which contains values, and a Map which gives the index in the Tuple for a given field name.

Author:
Alexandre Lefebvre

Constructor Summary
TuplePNameGetter(java.util.Map fieldName2index, Operand nc, Logger logger)
          Constructs a TuplePNameGetter from a set of associations (field name, index in tuple).
TuplePNameGetter(TuplePNameGetter tpng)
           
 
Method Summary
 java.math.BigDecimal pngetBigDecimalField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of an int field.
 java.math.BigInteger pngetBigIntegerField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of an int field.
 byte[] pngetByteArrayField(java.lang.String fn, java.lang.Object context)
          Retrieves the value of a byte[] field.
 byte pngetByteField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a byte field.
 char[] pngetCharArrayField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a char[] field.
 char pngetCharField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a char field.
 java.util.Date pngetDateField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a date field.
 int pngetIntField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of an int field.
 long pngetLongField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a long field.
 java.lang.Byte pngetObyteField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a Byte field.
 java.lang.Character pngetOcharField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a Character field.
 java.lang.Integer pngetOintField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of an Integer field.
 java.lang.Long pngetOlongField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a Long field.
 java.lang.Short pngetOshortField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a Short field.
 short pngetShortField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a short field.
 java.lang.String pngetStringField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a string field.
 void setMap(java.util.Map fieldName2index)
          Sets the field name to index association map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TuplePNameGetter

public TuplePNameGetter(TuplePNameGetter tpng)

TuplePNameGetter

public TuplePNameGetter(java.util.Map fieldName2index,
                        Operand nc,
                        Logger logger)
Constructs a TuplePNameGetter from a set of associations (field name, index in tuple).

Parameters:
fieldName2index - is the Map which contains the association field name -> index in tuple.
Method Detail

setMap

public void setMap(java.util.Map fieldName2index)
Sets the field name to index association map.

Parameters:
fieldName2index - is the Map which contains the association field name -> index in tuple.

pngetByteArrayField

public byte[] pngetByteArrayField(java.lang.String fn,
                                  java.lang.Object context)
                           throws PException
Retrieves the value of a byte[] field.

Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
Returns:
The byte[] value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetByteField

public byte pngetByteField(java.lang.String fn,
                           java.lang.Object context)
                    throws PException
It retrieves the value of a byte field.

Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
Returns:
The byte value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetCharField

public char pngetCharField(java.lang.String fn,
                           java.lang.Object context)
                    throws PException
It retrieves the value of a char field.

Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
Returns:
The char value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetCharArrayField

public char[] pngetCharArrayField(java.lang.String fn,
                                  java.lang.Object context)
                           throws PException
It retrieves the value of a char[] field.

Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
Returns:
The char[] value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetShortField

public short pngetShortField(java.lang.String fn,
                             java.lang.Object context)
                      throws PException
It retrieves the value of a short field.

Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
Returns:
The short value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetObyteField

public java.lang.Byte pngetObyteField(java.lang.String fn,
                                      java.lang.Object ctxt)
                               throws PException
It retrieves the value of a Byte field.

Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The Byte value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetOcharField

public java.lang.Character pngetOcharField(java.lang.String fn,
                                           java.lang.Object ctxt)
                                    throws PException
It retrieves the value of a Character field.

Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The Character value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetOshortField

public java.lang.Short pngetOshortField(java.lang.String fn,
                                        java.lang.Object ctxt)
                                 throws PException
It retrieves the value of a Short field.

Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The Short value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetOintField

public java.lang.Integer pngetOintField(java.lang.String fn,
                                        java.lang.Object ctxt)
                                 throws PException
It retrieves the value of an Integer field.

Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The Integer value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetOlongField

public java.lang.Long pngetOlongField(java.lang.String fn,
                                      java.lang.Object ctxt)
                               throws PExceptionTyping,
                                      PExceptionIO
It retrieves the value of a Long field.

Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The Long value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetDateField

public java.util.Date pngetDateField(java.lang.String fn,
                                     java.lang.Object ctxt)
                              throws PExceptionTyping,
                                     PExceptionIO
It retrieves the value of a date field.

Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The java.util.Date value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetIntField

public int pngetIntField(java.lang.String fn,
                         java.lang.Object context)
                  throws PException
It retrieves the value of an int field.

Parameters:
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
fn - A String containing the name of the field.
Returns:
The int value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetBigDecimalField

public java.math.BigDecimal pngetBigDecimalField(java.lang.String fn,
                                                 java.lang.Object context)
                                          throws PException
It retrieves the value of an int field.

Parameters:
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
fn - A String containing the name of the field.
Returns:
The BigDecimal value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetBigIntegerField

public java.math.BigInteger pngetBigIntegerField(java.lang.String fn,
                                                 java.lang.Object context)
                                          throws PException
It retrieves the value of an int field.

Parameters:
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
fn - A String containing the name of the field.
Returns:
The BigInteger value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetLongField

public long pngetLongField(java.lang.String fn,
                           java.lang.Object context)
                    throws PException
It retrieves the value of a long field.

Parameters:
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
fn - A String containing the name of the field.
Returns:
The long value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetStringField

public java.lang.String pngetStringField(java.lang.String fn,
                                         java.lang.Object context)
                                  throws PExceptionTyping,
                                         PExceptionIO
It retrieves the value of a string field.

Parameters:
context - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
fn - A String containing the name of the field.
Returns:
The java.lang.String value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.