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 DBFMappingClass
The class that maps class fields to DBF fieldsint
static final int
protected String
Represents the name of the column for the object nameprotected String
Represents the name of the column for the object IDstatic String
The DBF Tag that represents the ID of the objectint
protected static String
The DBF Tag that represents the name of the objectstatic final int
Fields inherited from class hec.model.AbstractDataObject
_dataList, _id, _isLocked, _loaded, _objRefs, _observerList, _outOfDateData, _parent, _propertyChangeSupport
Fields 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 void
void
getFieldObject
(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.long
getId()
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 databaseboolean
loadData()
this method should be called from the concrete class's loadData method to ensure that the object references get loaded correctly.void
boolean
setFieldObject
(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, setParent
Methods inherited from class hec.lang.NamedType
addModifiableListener, clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, isModified, isValid, readResolve, removeModifiableListener, rename, set, setIgnoreModifiedEvents, setIndex, setValid, update, useRecursiveModifiedTest
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hec.model.DataObject
copyInto, getDescription, isModified
Methods 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:DBFSerializable
Returns the necessary mapping information that maps a member field to a column in the DBF file.- Specified by:
getMappingInformation
in interfaceDBFSerializable
- 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 interfaceDataObject
- Overrides:
loadData
in classAbstractDataObject
-
getIDTag
Returns the Tag that represents the ID field in the DBF file.- Specified by:
getIDTag
in interfaceDBFSerializable
- Returns:
- The string tag value
-
getId
public long getId()Description copied from interface:DataStruct
return this DataStruct's ID- Specified by:
getId
in interfaceDataStruct
- Specified by:
getId
in interfaceDBFSerializable
- Overrides:
getId
in classAbstractDataObject
-
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 interfaceDBFSerializable
- Returns:
- The string tag value
-
getName
Description copied from class:NamedType
get the NameType's name- Specified by:
getName
in interfaceDataObject
- Specified by:
getName
in interfaceDBFSerializable
- Overrides:
getName
in classNamedType
- Returns:
- the name
-
locked
- Specified by:
locked
in interfaceLockListener
-
DataChanged
- Specified by:
DataChanged
in interfaceDataChangeListener
- Overrides:
DataChanged
in classAbstractDataObject
-
toString
-
getFieldObject
Description copied from interface:FieldAccessor
This method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObject
in interfaceFieldAccessor
- Overrides:
getFieldObject
in classAbstractDataObject
- Parameters:
fld
- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessor
This allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObject
in interfaceFieldAccessor
- Overrides:
setFieldObject
in 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
-