Package hec.model

Class AbstractDBFObject

All Implemented Interfaces:
AbstractDataListener, DataChangeListener, LockListener, hec.io.AsciiSerializable, DataObject, DataStruct, Serializable, Cloneable, Comparable, EventListener, Observer, mil.army.usace.hec.dbf.DBFSerializable, mil.army.usace.hec.dbf.IdReadable, mil.army.usace.hec.dbf.IdWritable, Modifiable
Direct Known Subclasses:
ModifiedTime

public abstract class AbstractDBFObject extends AbstractDataObject implements mil.army.usace.hec.dbf.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 mil.army.usace.hec.dbf.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 mil.army.usace.hec.dbf.DBFMappingClass getMappingInformation()
      Specified by:
      getMappingInformation in interface mil.army.usace.hec.dbf.DBFSerializable
    • 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 mil.army.usace.hec.dbf.DBFSerializable
    • 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 mil.army.usace.hec.dbf.DBFSerializable
      Specified by:
      getId in interface mil.army.usace.hec.dbf.IdReadable
      Overrides:
      getId in class AbstractDataObject
    • getNameTag

      public String getNameTag()
      Specified by:
      getNameTag in interface mil.army.usace.hec.dbf.DBFSerializable
    • 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 mil.army.usace.hec.dbf.DBFSerializable
      Overrides:
      getName in class NamedType
      Returns:
      the name
    • locked

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

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

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

      public Object getFieldObject(Field fld)
      Specified by:
      getFieldObject in interface hec.io.AsciiSerializable
      Specified by:
      getFieldObject in interface mil.army.usace.hec.dbf.DBFSerializable
      Overrides:
      getFieldObject in class AbstractDataObject
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Specified by:
      setFieldObject in interface hec.io.AsciiSerializable
      Specified by:
      setFieldObject in interface mil.army.usace.hec.dbf.DBFSerializable
      Overrides:
      setFieldObject in class AbstractDataObject