|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jlf.dataMap.DataObject
Abstract class used as the base of all objects in the data mapping framework.
It holds and manipulates collections of DataAttribute
s.
DataAttribute
,
Serialized FormField Summary | |
protected static java.lang.String |
ATTRIBUTE_DESCRIPTOR_VECTOR_VARIABLE_NAME
|
protected java.util.Hashtable |
attributes
Holds all the lazy-initialized attributes for this particular business object. |
protected static int |
INITIAL_ATTRIBUTE_DESCRIPTOR_HASHTABLE_SIZE
|
protected static int |
INITIAL_ATTRIBUTE_HASHTABLE_SIZE
|
Constructor Summary | |
DataObject()
|
Method Summary | |
protected boolean |
attributeEquals(java.util.Hashtable mainAttributeTable,
java.util.Hashtable comparisionAttributeTable)
This is a helper method to compare two Hashtables of DataAttributes. |
protected java.util.Hashtable |
basicGetAttributeDescriptors()
Returns a hash table of DataAttribute
objects pertinent to the DataMappedObject . |
boolean |
equals(java.lang.Object object)
Re-implement the equals method to compare two DataObject s. |
java.util.Set |
getAllAttributeNames()
Returns a set of attribute names (Strings) for all of the attribute descriptors available to the object. |
DataAttribute |
getAttribute(java.lang.String name)
Returns a attribute object for a particular attribute name. |
DataAttributeDescriptor |
getAttributeDescriptor(java.lang.String name)
Returns a attribute descriptor for a particular attribute name. |
protected java.util.Hashtable |
getAttributeDescriptors()
Returns a lazy-initialized collection of DataAttribute
objects pertinent to the DataMappedObject . |
java.lang.Object |
getAttributeValue(java.lang.String name)
Returns the value of an attribute object for a particular attribute name. |
double |
getDoubleAttribute(java.lang.String name)
Returns the value of an attribute as a double. |
long |
getLongAttribute(java.lang.String name)
Returns the value of an attribute as a long. |
java.lang.String |
getStringAttribute(java.lang.String name)
Returns the value of an attribute as a String. |
boolean |
hasAttributeDefined(java.lang.String attributeName)
Determines whether a data object has a named data attribute defined. |
int |
hashCode()
Re-implement the hashCode() method to synch with equals(Object) method, hashing all of the attribute values. |
void |
setAttributeValue(java.lang.String name,
java.lang.Object value)
Passthrough method to set an attribute's value with a non-type-specific accessor. |
void |
setDoubleAttribute(java.lang.String name,
double value)
Sets the value of an attribute as a double. |
void |
setLongAttribute(java.lang.String name,
long value)
Sets the value of an attribute as a long. |
void |
setStringAttribute(java.lang.String name,
java.lang.String value)
Sets the value of an attribute as a String. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int INITIAL_ATTRIBUTE_DESCRIPTOR_HASHTABLE_SIZE
protected static final int INITIAL_ATTRIBUTE_HASHTABLE_SIZE
protected static final java.lang.String ATTRIBUTE_DESCRIPTOR_VECTOR_VARIABLE_NAME
protected java.util.Hashtable attributes
Constructor Detail |
public DataObject()
Method Detail |
protected java.util.Hashtable basicGetAttributeDescriptors()
DataAttribute
objects pertinent to the DataMappedObject
. This
method is not lazy-initialized. Subclasses with attributes
SHOULD OVERRIDE this method, calling the superclass method of
same name and adding to the Hashtable any
DataAttributeDescriptor
objects pertinent. Use
the attribute name as the key and a
DataAttributeDescriptor
object as the value.At this level in the hierarchy, no attribute descriptors are known. Return an empty hash table that can be populated by the subclass(es).
protected java.util.Hashtable getAttributeDescriptors()
DataAttribute
objects pertinent to the DataMappedObject
.
This method uses a ClassInstanceVariable
as a convenient way to do the lazy-initialization.
public java.util.Set getAllAttributeNames()
public boolean hasAttributeDefined(java.lang.String attributeName)
public DataAttributeDescriptor getAttributeDescriptor(java.lang.String name)
DataAttributeDescriptor
if found
DataMapError
- if attribute descriptor not foundpublic DataAttribute getAttribute(java.lang.String name)
DataAttribute
if found
DataMapError
- if attribute name not foundpublic java.lang.Object getAttributeValue(java.lang.String name)
public void setAttributeValue(java.lang.String name, java.lang.Object value)
public java.lang.String getStringAttribute(java.lang.String name)
public void setStringAttribute(java.lang.String name, java.lang.String value)
public long getLongAttribute(java.lang.String name)
public void setLongAttribute(java.lang.String name, long value)
public double getDoubleAttribute(java.lang.String name)
public void setDoubleAttribute(java.lang.String name, double value)
protected boolean attributeEquals(java.util.Hashtable mainAttributeTable, java.util.Hashtable comparisionAttributeTable)
public boolean equals(java.lang.Object object)
DataObject
s. This method considers them equal
if the two have identical attribute names with identical values.
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |