Package hec.model
Class AbstractDBFObject
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.model.AbstractDataObject
hec.model.AbstractDBFObject
- All Implemented Interfaces:
AbstractDataListener,DataChangeListener,LockListener,AsciiSerializable,DBFSerializable,FieldAccessor,DataObject,DataStruct,Serializable,Cloneable,Comparable,EventListener,Observer,Modifiable
- Direct Known Subclasses:
ModifiedTime,SimpleCustomUserTypeObject,SimpleParentDbfObject
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 Summary
FieldsModifier and TypeFieldDescriptionprotected DBFMappingClassThe class that maps class fields to DBF fieldsintstatic final intprotected StringRepresents the name of the column for the object nameprotected StringRepresents the name of the column for the object IDstatic StringThe DBF Tag that represents the ID of the objectintprotected static StringThe DBF Tag that represents the name of the objectstatic final intFields inherited from class hec.model.AbstractDataObject
_dataList, _id, _isLocked, _loaded, _objRefs, _observerList, _outOfDateData, _parent, _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 TypeMethodDescriptionprotected voidvoidgetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.longgetId()return this DataStruct's IDgetIDTag()Returns the Tag that represents the ID field in the DBF file.Returns the necessary mapping information that maps a member field to a column in the DBF file.getName()get the NameType's nameReturns the string TAG that allows the database to select the name column of data in that databasebooleanloadData()this method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.voidbooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.toString()Methods inherited from class hec.model.AbstractDataObject
addObjectReference, addObserver, addPropertyChangeListener, addPropertyChangeListener, copyInto, decrementRefCnt, delete, fireDataChangeEvent, getCommonDataListContainer, getData, getDataList, getGmtOffset, getLocked, getObjectReferences, getParent, getRefCnt, getUnitSystem, incrementRefCnt, isLoaded, loadId, locked, reload, removeObjectReference, removeObjectReference, removeObserver, removePropertyChangeSupport, removePropertyChangeSupport, save, setDataList, setDescription, setId, setLocked, setModified, setName, setParentMethods inherited from class hec.lang.NamedType
addModifiableListener, clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, isModified, isValid, readResolve, removeModifiableListener, rename, set, setIgnoreModifiedEvents, setIndex, setValid, 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, isModifiedMethods inherited from interface hec.io.DBFSerializable
setId
-
Field Details
-
FALSE
public static final int FALSE- See Also:
-
TRUE
public static final int TRUE- See Also:
-
ID_TAG
The DBF Tag that represents the ID of the object -
NAME_TAG
The DBF Tag that represents the name of the object -
FD_ID
Represents the name of the column for the object name -
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
The class that maps class fields to DBF fields
-
-
Constructor Details
-
AbstractDBFObject
public AbstractDBFObject() -
AbstractDBFObject
-
-
Method Details
-
createMappingInfo
protected void createMappingInfo() -
getMappingInformation
Description copied from interface:DBFSerializableReturns the necessary mapping information that maps a member field to a column in the DBF file.- Specified by:
getMappingInformationin interfaceDBFSerializable- Returns:
- The mapping object
-
loadData
public boolean loadData()Description copied from class:AbstractDataObjectthis method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.- Specified by:
loadDatain interfaceDataObject- Overrides:
loadDatain classAbstractDataObject
-
getIDTag
Returns the Tag that represents the ID field in the DBF file.- Specified by:
getIDTagin interfaceDBFSerializable- Returns:
- The string tag value
-
getId
public long getId()Description copied from interface:DataStructreturn this DataStruct's ID- Specified by:
getIdin interfaceDataStruct- Specified by:
getIdin interfaceDBFSerializable- Overrides:
getIdin classAbstractDataObject
-
getNameTag
Description copied from interface:DBFSerializableReturns the string TAG that allows the database to select the name column of data in that database- Specified by:
getNameTagin interfaceDBFSerializable- Returns:
- The string tag value
-
getName
Description copied from class:NamedTypeget the NameType's name- Specified by:
getNamein interfaceDataObject- Specified by:
getNamein interfaceDBFSerializable- Overrides:
getNamein classNamedType- Returns:
- the name
-
locked
- Specified by:
lockedin interfaceLockListener
-
DataChanged
- Specified by:
DataChangedin interfaceDataChangeListener- Overrides:
DataChangedin classAbstractDataObject
-
toString
-
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 classAbstractDataObject- 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 classAbstractDataObject- 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
-