com.objex.panywhere
Class Data

java.lang.Object
  extended by com.objex.panywhere.Data
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TableData

public class Data
extends java.lang.Object
implements java.io.Serializable

Describes custom data for a person in a pedigree. Each data item added to a person must be linked to a unique field that is defined in the ProgenyAnywhere data dictionary.
The data dictionary is a lightweight local database used to define only those fields in the user's database that were loaded into the control in order to be able to identify the types and character of custom data added to people in the pedigree.
The example below shows how a field in a ProgenyAywhere datadictionary is used to add data to a person.

 
       DatabaseTable table = new DatabaseTable();
        table.setTableid(1);
        table.setTablename("localdict");

        int FIELDID = 1;
        DatabaseField field1 = new DatabaseField();
        field1.setFieldid(FIELDID);
        field1.setFieldname("Field 1");
        field1.setDatatype(DataType.TEXT_TYPE);
        table.addField(field1);
        Pedigree.getDatadictionary().setTable(table);

        //Now add data to a person using the database field defined above
        Individual ind = Pedigree.getFamily().getIndividual("1");
        Data l_data = new Data();
        l_data.setFieldid(FIELDID);
        l_data.setValue("Field 1 Value");
        ind.setData(l_data);

 
 
In the example above the type of the data added to the person is of type text. That type is linked (via fieldid) to the DataDictionary database field with the same fieldid as the one
used to add data to the person

See Also:
TableData, Serialized Form

Constructor Summary
Data()
          Creates a new Data object with default properties
 
Method Summary
 int getFieldid()
           
 java.lang.String getFieldname()
          Getter for property fieldname.
 java.lang.Object getValue()
           
 void setFieldid(int ai_fieldid)
          Sets the database fieldid for the field to which this data item relates.
 void setFieldname(java.lang.String rhs)
          Setter for property fieldname.
 void setValue(java.lang.Object aValue)
          Sets the new value for this data item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Data

public Data()
Creates a new Data object with default properties

Method Detail

getFieldname

public java.lang.String getFieldname()
Getter for property fieldname.

Returns:
Value of property fieldname.

setFieldname

public void setFieldname(java.lang.String rhs)
Setter for property fieldname.

Parameters:
rhs - New value of property fieldname.

getFieldid

public int getFieldid()
Returns:
The database fieldid for the field to which this data item relates

setFieldid

public void setFieldid(int ai_fieldid)
Sets the database fieldid for the field to which this data item relates.

Parameters:
ai_fieldid - The new fieldid linking this dataitem to the database

getValue

public java.lang.Object getValue()
Returns:
The value for this data item

setValue

public void setValue(java.lang.Object aValue)
Sets the new value for this data item

Parameters:
aValue - The new value for this data item