Package hec.model

Class AbstractDBFObject

All Implemented Interfaces:
hec.event.AbstractDataListener, hec.event.DataChangeListener, hec.event.LockListener, AsciiSerializable, DBFSerializable, FieldAccessor, DataObject, DataStruct, Serializable, Cloneable, Comparable, EventListener, Observer, rma.lang.Modifiable
Direct Known Subclasses:
ModifiedTime, SimpleCustomUserTypeObject, SimpleParentDbfObject

public abstract class AbstractDBFObject extends AbstractDataObject implements DBFSerializable
This class provides a base in which to derive data objects from that can be Serialized into a DBF database file. This class subclass hec.model.AbstractDataObject and takes care of generating the DBF information for the Name/Description/ID. All sublasses should override the createMappingInformation method to add there own mapping information. Also classes should override setFieldObject and getFieldObject in order for the DBFSerializer to get the neccessary fields from the Object.
Since:
December 6, 2000
See Also:
  • Field Details

    • FALSE

      public static final int FALSE
      See Also:
    • TRUE

      public static final int TRUE
      See Also:
    • ID_TAG

      public static String ID_TAG
      The DBF Tag that represents the ID of the object
    • NAME_TAG

      protected static String NAME_TAG
      The DBF Tag that represents the name of the object
    • FD_ID

      protected String FD_ID
      Represents the name of the column for the object name
    • FD_NAME

      protected String FD_NAME
      Represents the name of the column for the object ID
    • NAME_SIZE

      public int NAME_SIZE
    • DESC_SIZE

      public int DESC_SIZE
    • _dbfMap

      protected DBFMappingClass _dbfMap
      The class that maps class fields to DBF fields
  • Constructor Details

    • AbstractDBFObject

      public AbstractDBFObject()
    • AbstractDBFObject

      public AbstractDBFObject(long id, CommonDataList datalist)
  • Method Details

    • createMappingInfo

      protected void createMappingInfo()
    • getMappingInformation

      public DBFMappingClass getMappingInformation()
      Description copied from interface: DBFSerializable
      Returns the necessary mapping information that maps a member field to a column in the DBF file.
      Specified by:
      getMappingInformation in interface DBFSerializable
      Returns:
      The mapping object
    • loadData

      public boolean loadData()
      Description copied from class: AbstractDataObject
      this method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.
      Specified by:
      loadData in interface DataObject
      Overrides:
      loadData in class AbstractDataObject
    • getIDTag

      public String getIDTag()
      Returns the Tag that represents the ID field in the DBF file.
      Specified by:
      getIDTag in interface DBFSerializable
      Returns:
      The string tag value
    • getId

      public long getId()
      Description copied from interface: DataStruct
      return this DataStruct's ID
      Specified by:
      getId in interface DataStruct
      Specified by:
      getId in interface DBFSerializable
      Overrides:
      getId in class AbstractDataObject
    • getNameTag

      public String getNameTag()
      Description copied from interface: DBFSerializable
      Returns the string TAG that allows the database to select the name column of data in that database
      Specified by:
      getNameTag in interface DBFSerializable
      Returns:
      The string tag value
    • getName

      public String getName()
      Description copied from class: NamedType
      get the NameType's name
      Specified by:
      getName in interface DataObject
      Specified by:
      getName in interface DBFSerializable
      Overrides:
      getName in class NamedType
      Returns:
      the name
    • locked

      public void locked(hec.event.LockEvent le)
      Specified by:
      locked in interface hec.event.LockListener
    • DataChanged

      public void DataChanged(hec.event.DataChangeEvent e)
      Specified by:
      DataChanged in interface hec.event.DataChangeListener
      Overrides:
      DataChanged in class AbstractDataObject
    • toString

      public String toString()
      Overrides:
      toString in class NamedType
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class AbstractDataObject
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class AbstractDataObject
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful