public abstract class MappedAttributesObject
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
ivHashCode
The object's hash code.
|
protected java.lang.String[] |
ivHashFlds
The object's set of hash code field names.
|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
ivObjAttrs
The object's attribute field names and values.
|
private static long |
serialVersionUID
The class' serialization version id.
|
Modifier | Constructor and Description |
---|---|
protected |
MappedAttributesObject()
The constructor for the abstract object.
|
protected |
MappedAttributesObject(java.lang.String[] hashflds)
The constructor for the abstract object.
|
Modifier and Type | Method and Description |
---|---|
void |
cloneMapAttributes(MappedAttributesObject obj)
Clones this object's map of attribute field names and values and assigns
the cloned map of attributes to the given object.
|
abstract boolean |
equals(java.lang.Object obj)
Compares the given object to this object and determines if the two are
equal.
|
java.lang.String |
formatValue(java.lang.String fldname)
Returns a formatted string for the given field name.
|
java.lang.String |
formatValue(java.lang.String fldname,
boolean fmtgrps)
Returns a formatted string for the given field name.
|
java.lang.String[] |
getHashFields()
Returns this object's set of hash code field names.
|
protected java.util.ArrayList<?> |
getMapArrayList(java.lang.String fldname)
Returns a field's value from the map of attributes as an array list.
|
java.util.HashMap<java.lang.String,java.lang.Object> |
getMapAttributes()
Returns the map of object attribute field names and values.
|
protected java.math.BigDecimal |
getMapBigDecimal(java.lang.String fldname)
Returns a field's value from the map of attributes as a big decimal.
|
protected boolean |
getMapBoolean(java.lang.String fldname)
Returns a field's value from the map of attributes as a boolean.
|
protected java.util.Date |
getMapDate(java.lang.String fldname)
Returns a field's value from the map of attributes as a date.
|
protected double |
getMapDouble(java.lang.String fldname)
Returns a field's value from the map of attributes as a double.
|
protected int |
getMapInteger(java.lang.String fldname)
Returns a field's value from the map of attributes as an int.
|
protected long |
getMapLong(java.lang.String fldname)
Returns a field's value from the map of attributes as a long.
|
protected MappedAttributesObject |
getMapMapped(java.lang.String fldname)
Returns a field's value from the map of attributes as a mapped attributes
object.
|
java.lang.Object |
getMapObject(java.lang.String fldname)
Returns a field's value from the map of attributes as an object.
|
protected short |
getMapShort(java.lang.String fldname)
Returns a field's value from the map of attributes as a short.
|
protected java.lang.String |
getMapString(java.lang.String fldname)
Returns a field's value from the map of attributes as a string.
|
protected java.lang.String |
getMapString(java.lang.String fldname,
boolean trim)
Returns a field's value from the map of attributes as a string.
|
protected java.lang.StringBuffer |
getMapStringBuffer(java.lang.String fldname)
Returns a field's value from the map of attributes as a string buffer.
|
protected java.lang.StringBuilder |
getMapStringBuilder(java.lang.String fldname)
Returns a field's value from the map of attributes as a string builder.
|
protected java.sql.Time |
getMapTime(java.lang.String fldname)
Returns a field's value from the map of attributes as a date.
|
protected java.util.Date |
getMapTimestamp(java.lang.String fldname)
Returns a field's value from the map of attributes as a date.
|
protected java.util.Vector<?> |
getMapVector(java.lang.String fldname)
Returns a field's value from the map of attributes as a vector.
|
int |
hashCode()
Returns a hash code for this object based on the field names supplied
on the constructor.
|
void |
setHashFields(java.lang.String[] hashFlds)
Sets this object's set of hash code field names.
|
protected void |
setMap(java.lang.String fldname,
java.util.ArrayList<?> value)
Sets a field's value in the map of attributes to an array list.
|
protected void |
setMap(java.lang.String fldname,
java.math.BigDecimal value)
Sets a field's value in the map of attributes to a big decimal.
|
protected void |
setMap(java.lang.String fldname,
boolean value)
Sets a field's value in the map of attributes to a boolean.
|
protected void |
setMap(java.lang.String fldname,
java.util.Date value)
Sets a field's value in the map of attributes to a date.
|
protected void |
setMap(java.lang.String fldname,
double value)
Sets a field's value in the map of attributes to a double.
|
protected void |
setMap(java.lang.String fldname,
int value)
Sets a field's value in the map of attributes to an int.
|
protected void |
setMap(java.lang.String fldname,
long value)
Sets a field's value in the map of attributes to a long.
|
protected void |
setMap(java.lang.String fldname,
MappedAttributesObject value)
Sets a field's value in the map of attributes to a mapped attributes
object.
|
protected void |
setMap(java.lang.String fldname,
short value)
Sets a field's value in the map of attributes to a short.
|
protected void |
setMap(java.lang.String fldname,
java.lang.String value)
Sets a field's value in the map of attributes to a string.
|
protected void |
setMap(java.lang.String fldname,
java.lang.String value,
boolean trim)
Sets a field's value in the map of attributes to a string.
|
protected void |
setMap(java.lang.String fldname,
java.lang.StringBuffer value)
Sets a field's value in the map of attributes to a string buffer.
|
protected void |
setMap(java.lang.String fldname,
java.lang.StringBuilder value)
Sets a field's value in the map of attributes to a string builder.
|
protected void |
setMap(java.lang.String fldname,
java.sql.Time value)
Sets a field's value in the map of attributes to a time.
|
protected void |
setMap(java.lang.String fldname,
java.util.Vector<?> value)
Sets a field's value in the map of attributes to a vector.
|
void |
setMapAttributes(java.util.HashMap<java.lang.String,java.lang.Object> attrs)
Sets the map of object attribute field names and values.
|
void |
setMapObject(java.lang.String fldname,
java.lang.Object value)
Sets a field's value in the map of attributes to an object.
|
protected void |
setMapTime(java.lang.String fldname,
java.util.Date value)
Sets a field's value in the map of attributes to a time.
|
protected void |
setMapTimestamp(java.lang.String fldname,
java.util.Date value)
Sets a field's value in the map of attributes to a timestamp.
|
java.lang.String[] |
toStringArray(java.lang.String[] fields)
Returns a formatted string array for the given array of field names.
|
private static final long serialVersionUID
protected java.util.HashMap<java.lang.String,java.lang.Object> ivObjAttrs
protected java.lang.String[] ivHashFlds
protected int ivHashCode
protected MappedAttributesObject()
null
. The object's hash code is zero.protected MappedAttributesObject(java.lang.String[] hashflds)
null
.hashflds
- (String[]) The set of field names used to determine
the object's hash code. The field names supplied should match
the fields referenced in the object's equals
method. If
no fields names are supplied, the object's hash code is zero.public void cloneMapAttributes(MappedAttributesObject obj) throws java.lang.CloneNotSupportedException
obj
- (MappedAttributesObject) The object that will be assigned
the cloned map of attributes.java.lang.CloneNotSupportedException
- - if one or more of this object's
attributes cannot be cloned.public java.lang.String[] getHashFields()
public void setHashFields(java.lang.String[] hashFlds)
hashFlds
- (String[]) The hash code field names.public java.util.HashMap<java.lang.String,java.lang.Object> getMapAttributes()
public void setMapAttributes(java.util.HashMap<java.lang.String,java.lang.Object> attrs)
attrs
- (HashMap) The object's attribute field names values.protected java.util.ArrayList<?> getMapArrayList(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.math.BigDecimal getMapBigDecimal(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected boolean getMapBoolean(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.util.Date getMapDate(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected double getMapDouble(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected int getMapInteger(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected long getMapLong(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected MappedAttributesObject getMapMapped(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.public java.lang.Object getMapObject(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected short getMapShort(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.lang.String getMapString(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.lang.String getMapString(java.lang.String fldname, boolean trim)
fldname
- (String) The name of the field to retrieve.trim
- (boolean) true
if the returned value should
be trimmed, otherwise false
.protected java.lang.StringBuffer getMapStringBuffer(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.lang.StringBuilder getMapStringBuilder(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.sql.Time getMapTime(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.util.Date getMapTimestamp(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected java.util.Vector<?> getMapVector(java.lang.String fldname)
fldname
- (String) The name of the field to retrieve.protected void setMap(java.lang.String fldname, java.util.ArrayList<?> value)
fldname
- (String) The name of the field to set.value
- (ArrayList) The array list value to set.protected void setMap(java.lang.String fldname, java.math.BigDecimal value)
fldname
- (String) The name of the field to set.value
- (BigDecimal) The value to set.protected void setMap(java.lang.String fldname, boolean value)
fldname
- (String) The name of the field to set.value
- (boolean) The value to set.protected void setMap(java.lang.String fldname, java.sql.Time value)
fldname
- (String) The name of the field to set.value
- (java.sql.Time) The value to set.protected void setMap(java.lang.String fldname, java.util.Date value)
fldname
- (String) The name of the field to set.value
- (java.util.Date) The value to set.protected void setMap(java.lang.String fldname, double value)
fldname
- (String) The name of the field to set.value
- (double) The value to set.protected void setMap(java.lang.String fldname, int value)
fldname
- (String) The name of the field to set.value
- (int) The value to set.protected void setMap(java.lang.String fldname, long value)
fldname
- (String) The name of the field to set.value
- (long) The value to set.protected void setMap(java.lang.String fldname, MappedAttributesObject value)
fldname
- (String) The name of the field to set.value
- (MappedAttributesObject) The value to set.protected void setMap(java.lang.String fldname, short value)
fldname
- (String) The name of the field to set.value
- (short) The value to set.protected void setMap(java.lang.String fldname, java.lang.String value)
fldname
- (String) The name of the field to set.value
- (String) The value to set.protected void setMap(java.lang.String fldname, java.lang.String value, boolean trim)
fldname
- (String) The name of the field to set.value
- (String) The value to set.trim
- (boolean) true
if the string value should
be trimmed, otherwise false
.protected void setMap(java.lang.String fldname, java.lang.StringBuffer value)
fldname
- (String) The name of the field to set.value
- (StringBuffer) The value to set.protected void setMap(java.lang.String fldname, java.lang.StringBuilder value)
fldname
- (String) The name of the field to set.value
- (StringBuilder) The value to set.protected void setMap(java.lang.String fldname, java.util.Vector<?> value)
fldname
- (String) The name of the field to set.value
- (Vector) The vector value to set.public void setMapObject(java.lang.String fldname, java.lang.Object value)
fldname
- (String) The name of the field to set.value
- (Object) The object value to set.protected void setMapTime(java.lang.String fldname, java.util.Date value)
fldname
- (String) The name of the field to set.value
- (java.util.Date) The value to set.protected void setMapTimestamp(java.lang.String fldname, java.util.Date value)
fldname
- (String) The name of the field to set.value
- (java.util.Date) The value to set.public java.lang.String[] toStringArray(java.lang.String[] fields)
fields
- (String[]) An array of table field names.public java.lang.String formatValue(java.lang.String fldname)
For numbers: zero values are always formatted and always includes grouping separators.
fldname
- (String) The name of the field to format.public java.lang.String formatValue(java.lang.String fldname, boolean fmtgrps)
For numbers: zero values are always formatted and optionally includes grouping separators.
fldname
- (String) The name of the field to format.fmtgrps
- (boolean) true
if grouping separators are
to be included, otherwise false.public int hashCode()
hashCode
in class java.lang.Object
public abstract boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- (Object) The object to compare with this object.true
if the specified object is equal to
this object, otherwise false
.