Package hec.model
Class AbstractDataObject
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.model.AbstractDataObject
- All Implemented Interfaces:
AbstractDataListener,DataChangeListener,LockListener,AsciiSerializable,FieldAccessor,DataObject,DataStruct,Serializable,Cloneable,Comparable,EventListener,Observer,Modifiable
- Direct Known Subclasses:
AbstractDBFObject
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommonDataListprotected longprotected booleanprotected booleanprotected Vectorprotected Vectorprotected booleanprotected DataObjectprotected PropertyChangeSupportFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd a non-null unique DataObjectReference to this DataObject's list of DataObjectReferencesvoidadd an observer to myselfvoidvoidaddPropertyChangeListener(String property, PropertyChangeListener listener) voidcopyInto(DataObject dobj) copy DataObject do's data into this onevoidDataChanged(DataChangeEvent event) voidvoiddelete()This method is called so this object can clean up after itself and notify listenersvoidFires a Data Change Event to all of its listenersgetData()return this objects datareturn this DataObject's DataListgetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.intlonggetId()return this DataStruct's IDbooleanget an array of this DataObject's DataObjectReferences.get this objects parent Dataobject (if any)intintvoidfor counts of DataObjectReferences refering to this objectbooleanisLoaded()has this objects data been loaded?booleanloadData()this method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.booleanloadId()Stubbed out loadId method that always returns true.voidtell this object whether someone else has it's data locked or notvoidreload()set my reload flag and tell my observers that I have out of date datavoidremoveObjectReference(int pos) remove a DataObjectReference to this objectvoidRemoves an object reference from the listvoidremove an observer from my list of observersvoidvoidremovePropertyChangeSupport(String property, PropertyChangeListener listener) booleansave()tell this object's object references to save themselves s/b called at the end of the concrete class's save().booleansetDataList(CommonDataList datalist) set this DataObject's DataListvoidsetDescription(String desc) propagate the description change to all object refsbooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.booleansetId(long id) set this DataObject's IDvoidsetLocked(boolean locked) voidsetModified(boolean b) Set the modified flag to true or false.voidpropagate the name change to all object refsvoidsetParent(DataObject parent) set this objects parent DataObjectMethods inherited from class hec.lang.NamedType
addModifiableListener, clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setIgnoreModifiedEvents, setIndex, setValid, toString, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.model.DataObject
copyInto, getDescription, getName, isModifiedMethods inherited from interface hec.event.LockListener
locked
-
Field Details
-
_id
protected long _id -
_dataList
-
_objRefs
-
_loaded
protected transient boolean _loaded -
_observerList
-
_outOfDateData
protected transient boolean _outOfDateData -
_isLocked
protected transient boolean _isLocked -
_parent
-
_propertyChangeSupport
-
-
Constructor Details
-
AbstractDataObject
public AbstractDataObject() -
AbstractDataObject
-
-
Method Details
-
addPropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeSupport
-
removePropertyChangeSupport
-
setId
public boolean setId(long id) Description copied from interface:DataObjectset this DataObject's ID- Specified by:
setIdin interfaceDataObject
-
getId
public long getId()Description copied from interface:DataStructreturn this DataStruct's ID- Specified by:
getIdin interfaceDataStruct
-
getCommonDataListContainer
-
setDataList
Description copied from interface:DataObjectset this DataObject's DataList- Specified by:
setDataListin interfaceDataObject
-
getGmtOffset
public int getGmtOffset() -
getUnitSystem
public int getUnitSystem() -
getDataList
Description copied from interface:DataObjectreturn this DataObject's DataList- Specified by:
getDataListin interfaceDataObject
-
loadId
public boolean loadId()Stubbed out loadId method that always returns true. Required by the DataObject interface.- Specified by:
loadIdin interfaceDataObject- 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:
loadDatain interfaceDataObject
-
getObjectReferences
get an array of this DataObject's DataObjectReferences. will not return a null array- Specified by:
getObjectReferencesin interfaceDataObject
-
addObjectReference
add a non-null unique DataObjectReference to this DataObject's list of DataObjectReferences- Specified by:
addObjectReferencein interfaceDataObject
-
removeObjectReference
public void removeObjectReference(int pos) Description copied from interface:DataObjectremove a DataObjectReference to this object- Specified by:
removeObjectReferencein interfaceDataObject
-
removeObjectReference
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:
savein interfaceDataObject
-
addObserver
add an observer to myself- Specified by:
addObserverin interfaceDataObject
-
removeObserver
remove an observer from my list of observers- Specified by:
removeObserverin interfaceDataObject
-
reload
public void reload()set my reload flag and tell my observers that I have out of date data- Specified by:
reloadin interfaceDataObject
-
delete
public void delete()This method is called so this object can clean up after itself and notify listeners- Specified by:
deletein interfaceDataObject
-
fireDataChangeEvent
Fires a Data Change Event to all of its listeners -
DataChanged
- Specified by:
DataChangedin interfaceDataChangeListener
-
locked
tell this object whether someone else has it's data locked or not- Specified by:
lockedin interfaceDataObject
-
setLocked
public void setLocked(boolean locked) -
getLocked
public boolean getLocked() -
getData
Description copied from interface:DataObjectreturn this objects data- Specified by:
getDatain interfaceDataObject
-
isLoaded
public boolean isLoaded()Description copied from interface:DataObjecthas this objects data been loaded?- Specified by:
isLoadedin interfaceDataObject
-
setName
propagate the name change to all object refs- Specified by:
setNamein interfaceDataObject- Overrides:
setNamein classNamedType
-
setDescription
propagate the description change to all object refs- Specified by:
setDescriptionin interfaceDataObject- Overrides:
setDescriptionin classNamedType
-
setParent
Description copied from interface:DataObjectset this objects parent DataObject- Specified by:
setParentin interfaceDataObject
-
getParent
Description copied from interface:DataObjectget this objects parent Dataobject (if any)- Specified by:
getParentin interfaceDataObject
-
incrementRefCnt
public void incrementRefCnt()Description copied from interface:DataObjectfor counts of DataObjectReferences refering to this object- Specified by:
incrementRefCntin interfaceDataObject
-
decrementRefCnt
public void decrementRefCnt()- Specified by:
decrementRefCntin interfaceDataObject
-
getRefCnt
public int getRefCnt()- Specified by:
getRefCntin interfaceDataObject
-
copyInto
Description copied from interface:DataObjectcopy DataObject do's data into this one- Specified by:
copyIntoin interfaceDataObject
-
setModified
public void setModified(boolean b) Description copied from class:NamedTypeSet the modified flag to true or false.- Specified by:
setModifiedin interfaceDataObject- Specified by:
setModifiedin interfaceModifiable- Overrides:
setModifiedin classNamedType
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classNamedType- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin classNamedType- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-