Package hec.model

Class AbstractDataObject

All Implemented Interfaces:
AbstractDataListener, DataChangeListener, LockListener, AsciiSerializable, FieldAccessor, DataObject, DataStruct, Serializable, Cloneable, Comparable, EventListener, Observer, Modifiable
Direct Known Subclasses:
AbstractDBFObject

public abstract class AbstractDataObject extends NamedType implements DataObject, AsciiSerializable
See Also:
  • Field Details

    • _id

      protected long _id
    • _dataList

      protected transient CommonDataList _dataList
    • _objRefs

      protected Vector _objRefs
    • _loaded

      protected transient boolean _loaded
    • _observerList

      protected transient Vector _observerList
    • _outOfDateData

      protected transient boolean _outOfDateData
    • _isLocked

      protected transient boolean _isLocked
    • _parent

      protected transient DataObject _parent
    • _propertyChangeSupport

      protected transient PropertyChangeSupport _propertyChangeSupport
  • Constructor Details

    • AbstractDataObject

      public AbstractDataObject()
    • AbstractDataObject

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

    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
    • addPropertyChangeListener

      public void addPropertyChangeListener(String property, PropertyChangeListener listener)
    • removePropertyChangeSupport

      public void removePropertyChangeSupport(PropertyChangeListener listener)
    • removePropertyChangeSupport

      public void removePropertyChangeSupport(String property, PropertyChangeListener listener)
    • setId

      public boolean setId(long id)
      Description copied from interface: DataObject
      set this DataObject's ID
      Specified by:
      setId in interface DataObject
    • getId

      public long getId()
      Description copied from interface: DataStruct
      return this DataStruct's ID
      Specified by:
      getId in interface DataStruct
    • getCommonDataListContainer

      public CommonDataListContainer getCommonDataListContainer()
    • setDataList

      public boolean setDataList(CommonDataList datalist)
      Description copied from interface: DataObject
      set this DataObject's DataList
      Specified by:
      setDataList in interface DataObject
    • getGmtOffset

      public int getGmtOffset()
    • getUnitSystem

      public int getUnitSystem()
    • getDataList

      public CommonDataList getDataList()
      Description copied from interface: DataObject
      return this DataObject's DataList
      Specified by:
      getDataList in interface DataObject
    • loadId

      public boolean loadId()
      Stubbed out loadId method that always returns true. Required by the DataObject interface.
      Specified by:
      loadId in interface DataObject
      See Also:
    • loadData

      public boolean loadData()
      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
    • getObjectReferences

      public DataObjectReference[] getObjectReferences()
      get an array of this DataObject's DataObjectReferences. will not return a null array
      Specified by:
      getObjectReferences in interface DataObject
    • addObjectReference

      public boolean addObjectReference(DataObjectReference ref)
      add a non-null unique DataObjectReference to this DataObject's list of DataObjectReferences
      Specified by:
      addObjectReference in interface DataObject
    • removeObjectReference

      public void removeObjectReference(int pos)
      Description copied from interface: DataObject
      remove a DataObjectReference to this object
      Specified by:
      removeObjectReference in interface DataObject
    • removeObjectReference

      public void removeObjectReference(DataObjectReference ref)
      Removes an object reference from the list
    • save

      public boolean save()
      tell this object's object references to save themselves s/b called at the end of the concrete class's save().
      Specified by:
      save in interface DataObject
    • addObserver

      public void addObserver(AbstractDataListener doo)
      add an observer to myself
      Specified by:
      addObserver in interface DataObject
    • removeObserver

      public void removeObserver(AbstractDataListener doo)
      remove an observer from my list of observers
      Specified by:
      removeObserver in interface DataObject
    • reload

      public void reload()
      set my reload flag and tell my observers that I have out of date data
      Specified by:
      reload in interface DataObject
    • delete

      public void delete()
      This method is called so this object can clean up after itself and notify listeners
      Specified by:
      delete in interface DataObject
    • fireDataChangeEvent

      public void fireDataChangeEvent(DataChangeEvent dce)
      Fires a Data Change Event to all of its listeners
    • DataChanged

      public void DataChanged(DataChangeEvent event)
      Specified by:
      DataChanged in interface DataChangeListener
    • locked

      public void locked(boolean lock, String user)
      tell this object whether someone else has it's data locked or not
      Specified by:
      locked in interface DataObject
    • setLocked

      public void setLocked(boolean locked)
    • getLocked

      public boolean getLocked()
    • getData

      public DataStruct getData()
      Description copied from interface: DataObject
      return this objects data
      Specified by:
      getData in interface DataObject
    • isLoaded

      public boolean isLoaded()
      Description copied from interface: DataObject
      has this objects data been loaded?
      Specified by:
      isLoaded in interface DataObject
    • setName

      public void setName(String name)
      propagate the name change to all object refs
      Specified by:
      setName in interface DataObject
      Overrides:
      setName in class NamedType
    • setDescription

      public void setDescription(String desc)
      propagate the description change to all object refs
      Specified by:
      setDescription in interface DataObject
      Overrides:
      setDescription in class NamedType
    • setParent

      public void setParent(DataObject parent)
      Description copied from interface: DataObject
      set this objects parent DataObject
      Specified by:
      setParent in interface DataObject
    • getParent

      public DataObject getParent()
      Description copied from interface: DataObject
      get this objects parent Dataobject (if any)
      Specified by:
      getParent in interface DataObject
    • incrementRefCnt

      public void incrementRefCnt()
      Description copied from interface: DataObject
      for counts of DataObjectReferences refering to this object
      Specified by:
      incrementRefCnt in interface DataObject
    • decrementRefCnt

      public void decrementRefCnt()
      Specified by:
      decrementRefCnt in interface DataObject
    • getRefCnt

      public int getRefCnt()
      Specified by:
      getRefCnt in interface DataObject
    • copyInto

      public void copyInto(DataObject dobj)
      Description copied from interface: DataObject
      copy DataObject do's data into this one
      Specified by:
      copyInto in interface DataObject
    • setModified

      public void setModified(boolean b)
      Description copied from class: NamedType
      Set the modified flag to true or false.
      Specified by:
      setModified in interface DataObject
      Specified by:
      setModified in interface Modifiable
      Overrides:
      setModified 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 NamedType
      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 NamedType
      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