Package hec.data
Class AbstractJDomDataObject
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.data.AbstractJDomDataObject
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,Serializable,Cloneable,Comparable,Observer,Modifiable
- Direct Known Subclasses:
JDomAttributeParameterTypedValue,JDomCharacteristic,JDomCharacteristicType,JDomCharacteristicTypeRef,JDomEmbankmentImpl,JDomLocationLevelImpl,JDomLocationLevelRef,JDomLockCatalogImpl,JDomLockImpl,JDomLookupTypeImpl,JDomParameterTypedValueImpl,JDomProjectCatalogImpl,JDomProjectImpl,JDomSeasonalIntervalImpl,JDomSeasonalValueImpl,JDomSeasonalValuesImpl,JDomSpecifiedLevelImpl,JDomWaterSupplyPumpAccountingImpl,JDomWaterUserContractImpl,JDomWaterUserContractRef,JDomWaterUserImpl,OperationalProjectChanges,PhysicalStructure,PhysicalStructureOperationalChange,PhysicalStructureOperationalChangeRef,PhysicalStructureOperationalSetting
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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 TypeMethodDescriptionabstract voidbuildElement(org.jdom.Element element) Populates the element with data from this object.protected org.jdom.ElementbuildElementOrRemove(org.jdom.Element element, String childElementName, AbstractJDomDataObject jdom) static StringConverts a camelCase string to one with words separated by underbars (_) and lowercased.protected Stringstatic DategetXmlDate(org.jdom.Element parent, String childElementName, String dateFormat) static doublegetXmlValue(ParamDouble paramDouble, org.jdom.Element parent, String childElementName, int paramId) protected doubleparseDouble(org.jdom.Element parentElement, String childElementName, String[] units, double defaultValue) protected doubleparseFormattedDouble(org.jdom.Element parentElement, String childElementName, String[] units, double defaultValue) protected intstatic voidsetXmlDate(org.jdom.Element element, String childElementName, String dateFormat, Date date) static voidsetXmlValue(ParamDouble paramDouble, org.jdom.Element parent, String childElementName, Double value, int paramId) Writes an AbstractJDomDataObject to an xml string.Methods inherited from class hec.lang.NamedType
addModifiableListener, clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getFieldObject, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setFieldObject, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, toString, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
YYYY
- See Also:
-
MM_MYYYY
- See Also:
-
DD_MM_MYYYY
- See Also:
-
DD_MM_MYYYY_HHMM
- See Also:
-
DD_MM_MYYYY_HHMMZ
- See Also:
-
UNIT
- See Also:
-
-
Constructor Details
-
AbstractJDomDataObject
public AbstractJDomDataObject()
-
-
Method Details
-
buildElement
public abstract void buildElement(org.jdom.Element element) Populates the element with data from this object.- Parameters:
element-
-
parseInt
-
parseFormattedDouble
-
parseDouble
-
camelCaseToLowerUnderbar
Converts a camelCase string to one with words separated by underbars (_) and lowercased. Loosely based on: http://www.malethan.com/article/humanise_camel_case_in_java.html -
getDefaultElementName
-
toXmlString
Writes an AbstractJDomDataObject to an xml string. This method is mostly for debugging. The root element of the string that is returned is named based on a lowercased and underscored version of the classname. If the classname starts with "JDom" or ends with "Impl" those are removed.- Returns:
- the xml string
-
getXmlValue
public static double getXmlValue(ParamDouble paramDouble, org.jdom.Element parent, String childElementName, int paramId) -
setXmlValue
public static void setXmlValue(ParamDouble paramDouble, org.jdom.Element parent, String childElementName, Double value, int paramId) -
getXmlDate
-
setXmlDate
-
buildElementOrRemove
protected org.jdom.Element buildElementOrRemove(org.jdom.Element element, String childElementName, AbstractJDomDataObject jdom)
-