org.objectweb.medor.eval.lib

Class TuplePNameGetter

Implemented Interfaces:
PNameGetter

public class TuplePNameGetter
extends java.lang.Object
implements PNameGetter

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(Map fieldName2index, Operand nc, Logger logger)
Constructs a TuplePNameGetter from a set of associations (field name, index in tuple).
TuplePNameGetter(TuplePNameGetter tpng)

Method Summary

BigDecimal
pngetBigDecimalField(String fn, Object context)
It retrieves the value of an int field.
BigInteger
pngetBigIntegerField(String fn, Object context)
It retrieves the value of an int field.
byte[]
pngetByteArrayField(String fn, Object context)
Retrieves the value of a byte[] field.
byte
pngetByteField(String fn, Object context)
It retrieves the value of a byte field.
char[]
pngetCharArrayField(String fn, Object context)
It retrieves the value of a char[] field.
char
pngetCharField(String fn, Object context)
It retrieves the value of a char field.
Date
pngetDateField(String fn, Object ctxt)
It retrieves the value of a date field.
int
pngetIntField(String fn, Object context)
It retrieves the value of an int field.
long
pngetLongField(String fn, Object context)
It retrieves the value of a long field.
Byte
pngetObyteField(String fn, Object ctxt)
It retrieves the value of a Byte field.
Character
pngetOcharField(String fn, Object ctxt)
It retrieves the value of a Character field.
Integer
pngetOintField(String fn, Object ctxt)
It retrieves the value of an Integer field.
Long
pngetOlongField(String fn, Object ctxt)
It retrieves the value of a Long field.
Short
pngetOshortField(String fn, Object ctxt)
It retrieves the value of a Short field.
short
pngetShortField(String fn, Object context)
It retrieves the value of a short field.
String
pngetStringField(String fn, Object context)
It retrieves the value of a string field.
void
setMap(Map fieldName2index)
Sets the field name to index association map.

Constructor Details

TuplePNameGetter

public TuplePNameGetter(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.


TuplePNameGetter

public TuplePNameGetter(TuplePNameGetter tpng)

Method Details

pngetBigDecimalField

public BigDecimal pngetBigDecimalField(String fn,
                                       Object context)
            throws PException
It retrieves the value of an int 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 BigDecimal value of the field as stored within the composite name.


pngetBigIntegerField

public BigInteger pngetBigIntegerField(String fn,
                                       Object context)
            throws PException
It retrieves the value of an int 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 BigInteger value of the field as stored within the composite name.


pngetByteArrayField

public byte[] pngetByteArrayField(String fn,
                                  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.


pngetByteField

public byte pngetByteField(String fn,
                           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.


pngetCharArrayField

public char[] pngetCharArrayField(String fn,
                                  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.


pngetCharField

public char pngetCharField(String fn,
                           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.


pngetDateField

public Date pngetDateField(String fn,
                           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.


pngetIntField

public int pngetIntField(String fn,
                         Object context)
            throws PException
It retrieves the value of an int 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 int value of the field as stored within the composite name.


pngetLongField

public long pngetLongField(String fn,
                           Object context)
            throws PException
It retrieves the value of a long 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 long value of the field as stored within the composite name.


pngetObyteField

public Byte pngetObyteField(String fn,
                            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.


pngetOcharField

public Character pngetOcharField(String fn,
                                 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.


pngetOintField

public Integer pngetOintField(String fn,
                              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.


pngetOlongField

public Long pngetOlongField(String fn,
                            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.


pngetOshortField

public Short pngetOshortField(String fn,
                              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.


pngetShortField

public short pngetShortField(String fn,
                             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.


pngetStringField

public String pngetStringField(String fn,
                               Object context)
            throws PExceptionTyping,
                   PExceptionIO
It retrieves the value of a string 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 java.lang.String value of the field as stored within the composite name.


setMap

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

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