Class AbstractRecord

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map, Record
    Direct Known Subclasses:
    DatabaseRecord, EISMappedRecord, XMLRecord

    public abstract class AbstractRecord
    extends CoreAbstractRecord
    implements Record, java.lang.Cloneable, java.io.Serializable, java.util.Map

    Purpose: Define the abstract definition of a record for internal use. Public API should reference the Map or Record interface. Subclasses are DatabaseRecord and XMLRecord.

    Responsibilities:

    • Implement the Record and Map interfaces.
    See Also:
    DatabaseField, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Vector<DatabaseField> fields
      Use vector to store the fields/values for optimal performance.
      protected DatabaseField lookupField
      Optimize field creation for field name lookup.
      static AbstractRecord.NoEntry noEntry
      INTERNAL: indicator showing that no entry exists for a given key.
      protected boolean nullValueInFields
      INTERNAL: flag for any database field containing a null value
      protected int size
      PERF: Cache the row size.
      protected java.lang.Object sopObject
      INTERNAL: SerializedObjectPolicy support
      protected java.util.Vector values
      Use vector to store the fields/values for optimal performance.
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractRecord()
      INTERNAL: converts JDBC results to collections of rows.
      AbstractRecord​(int initialCapacity)
      INTERNAL: converts JDBC results to collections of rows.
      AbstractRecord​(java.util.Vector fields, java.util.Vector values)
      INTERNAL: converts JDBC results to collections of rows.
      AbstractRecord​(java.util.Vector fields, java.util.Vector values, int size)
      INTERNAL: converts JDBC results to collections of rows.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(DatabaseField key, java.lang.Object value)
      INTERNAL: Add the field-value pair to the row.
      void clear()
      PUBLIC: Clear the contents of the row.
      AbstractRecord clone()
      INTERNAL: Clone the row and its values.
      boolean contains​(java.lang.Object value)
      PUBLIC: Check if the value is contained in the row.
      boolean containsKey​(java.lang.Object key)
      PUBLIC: Check if the field is contained in the row.
      boolean containsKey​(java.lang.String fieldName)
      PUBLIC: Check if the field is contained in the row.
      boolean containsKey​(DatabaseField key)
      INTERNAL: Check if the field is contained in the row.
      boolean containsValue​(java.lang.Object value)
      PUBLIC: Check if the value is contained in the row.
      java.util.Enumeration elements()
      PUBLIC: Returns an Enumeration of the values.
      java.util.Set entrySet()
      PUBLIC: Returns a set of the keys.
      java.lang.Object get​(java.lang.Object key)
      PUBLIC: Retrieve the value for the field name.
      java.lang.Object get​(java.lang.String fieldName)
      PUBLIC: Retrieve the value for the field name.
      java.lang.Object get​(DatabaseField key)
      INTERNAL: Retrieve the value for the field.
      DatabaseField getField​(DatabaseField key)
      INTERNAL: Returns the row's field with the same name.
      java.util.Vector<DatabaseField> getFields()
      INTERNAL:
      java.lang.Object getIndicatingNoEntry​(java.lang.String fieldName)
      PUBLIC: Retrieve the value for the field name.
      java.lang.Object getIndicatingNoEntry​(DatabaseField key)
      INTERNAL: Retrieve the value for the field.
      protected DatabaseField getLookupField​(java.lang.String fieldName)
      Internal: factored out of getIndicatingNoEntry(String) to reduce complexity and have get(string) use get(DatabaseField) instead of getIndicatingNoEntry and then doing an extra check
      java.lang.Object getSopObject()
      INTERNAL:
      java.util.Vector getValues()
      INTERNAL:
      java.lang.Object getValues​(java.lang.String key)  
      java.lang.Object getValues​(DatabaseField key)  
      boolean hasNullValueInFields()
      INTERNAL: Return true if the AbstractRecord has been marked as valid to check the update call cache with, false otherwise.
      boolean hasSopObject()
      INTERNAL:
      boolean isEmpty()
      PUBLIC: Return if the row is empty.
      java.util.Enumeration keys()
      PUBLIC: Returns an Enumeration of the DatabaseField objects.
      java.util.Set keySet()
      PUBLIC: Returns a set of the keys.
      void mergeFrom​(AbstractRecord row)
      INTERNAL: Merge the provided row into this row.
      java.lang.Object put​(java.lang.Object key, java.lang.Object value)
      PUBLIC: Add the field-value pair to the row.
      java.lang.Object put​(java.lang.String key, java.lang.Object value)
      PUBLIC: Add the field-value pair to the row.
      java.lang.Object put​(DatabaseField key, java.lang.Object value)
      INTERNAL: Add the field-value pair to the row.
      void putAll​(java.util.Map map)
      PUBLIC: Add all of the elements.
      java.lang.Object remove​(java.lang.Object key)
      INTERNAL: Remove the field key from the row.
      java.lang.Object remove​(java.lang.String fieldName)
      INTERNAL: Remove the field key from the row.
      java.lang.Object remove​(DatabaseField key)
      INTERNAL: Remove the field key from the row.
      void replaceAt​(java.lang.Object value, int index)
      INTERNAL: replaces the value at index with value
      void replaceAt​(java.lang.Object value, DatabaseField key)
      INTERNAL: replaces the value at field with value
      protected void resetSize()
      Reset the row size.
      protected void setFields​(java.util.Vector fields)  
      void setNullValueInFields​(boolean nullValueInFields)
      INTERNAL: Set the validForUpdateCallCacheCheck attribute to true if the row does not contain nulls, false otherwise
      void setSopObject​(java.lang.Object sopObject)
      INTERNAL:
      protected void setValues​(java.util.Vector values)  
      int size()
      PUBLIC: Return the number of field/value pairs in the row.
      java.lang.String toString()
      INTERNAL:
      java.util.Collection values()
      PUBLIC: Returns an collection of the values.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • fields

        protected java.util.Vector<DatabaseField> fields
        Use vector to store the fields/values for optimal performance.
      • values

        protected java.util.Vector values
        Use vector to store the fields/values for optimal performance.
      • lookupField

        protected DatabaseField lookupField
        Optimize field creation for field name lookup.
      • size

        protected int size
        PERF: Cache the row size.
      • noEntry

        public static final AbstractRecord.NoEntry noEntry
        INTERNAL: indicator showing that no entry exists for a given key.
      • nullValueInFields

        protected boolean nullValueInFields
        INTERNAL: flag for any database field containing a null value
      • sopObject

        protected transient java.lang.Object sopObject
        INTERNAL: SerializedObjectPolicy support
    • Constructor Detail

      • AbstractRecord

        public AbstractRecord()
        INTERNAL: converts JDBC results to collections of rows.
      • AbstractRecord

        public AbstractRecord​(int initialCapacity)
        INTERNAL: converts JDBC results to collections of rows.
      • AbstractRecord

        public AbstractRecord​(java.util.Vector fields,
                              java.util.Vector values)
        INTERNAL: converts JDBC results to collections of rows.
      • AbstractRecord

        public AbstractRecord​(java.util.Vector fields,
                              java.util.Vector values,
                              int size)
        INTERNAL: converts JDBC results to collections of rows.
    • Method Detail

      • resetSize

        protected void resetSize()
        Reset the row size. This must be reset after any change to the row.
      • add

        public void add​(DatabaseField key,
                        java.lang.Object value)
        INTERNAL: Add the field-value pair to the row. Will not check, will simply add to the end of the row
      • clear

        public void clear()
        PUBLIC: Clear the contents of the row.
        Specified by:
        clear in interface java.util.Map
      • clone

        public AbstractRecord clone()
        INTERNAL: Clone the row and its values.
        Overrides:
        clone in class java.lang.Object
      • contains

        public boolean contains​(java.lang.Object value)
        PUBLIC: Check if the value is contained in the row.
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        PUBLIC: Check if the field is contained in the row. Conform to hashtable interface.
        Specified by:
        containsKey in interface java.util.Map
      • containsKey

        public boolean containsKey​(java.lang.String fieldName)
        PUBLIC: Check if the field is contained in the row.
      • containsKey

        public boolean containsKey​(DatabaseField key)
        INTERNAL: Check if the field is contained in the row.
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        PUBLIC: Check if the value is contained in the row.
        Specified by:
        containsValue in interface java.util.Map
      • elements

        public java.util.Enumeration elements()
        PUBLIC: Returns an Enumeration of the values.
      • entrySet

        public java.util.Set entrySet()
        PUBLIC: Returns a set of the keys.
        Specified by:
        entrySet in interface java.util.Map
      • get

        public java.lang.Object get​(java.lang.Object key)
        PUBLIC: Retrieve the value for the field name. A field is constructed on the name to check the hash table. If missing null is returned.
        Specified by:
        get in interface java.util.Map
      • get

        public java.lang.Object get​(java.lang.String fieldName)
        PUBLIC: Retrieve the value for the field name. A field is constructed on the name to check the hash table. If missing null is returned.
      • getLookupField

        protected DatabaseField getLookupField​(java.lang.String fieldName)
        Internal: factored out of getIndicatingNoEntry(String) to reduce complexity and have get(string) use get(DatabaseField) instead of getIndicatingNoEntry and then doing an extra check
        Parameters:
        fieldName -
        Returns:
      • getIndicatingNoEntry

        public java.lang.Object getIndicatingNoEntry​(java.lang.String fieldName)
        PUBLIC: Retrieve the value for the field name. A field is constructed on the name to check the hash table. If missing DatabaseRow.noEntry is returned.
      • get

        public java.lang.Object get​(DatabaseField key)
        INTERNAL: Retrieve the value for the field. If missing null is returned.
      • getValues

        public java.lang.Object getValues​(DatabaseField key)
      • getValues

        public java.lang.Object getValues​(java.lang.String key)
      • getIndicatingNoEntry

        public java.lang.Object getIndicatingNoEntry​(DatabaseField key)
        INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned.
      • getFields

        public java.util.Vector<DatabaseField> getFields()
        INTERNAL:
      • getValues

        public java.util.Vector getValues()
        INTERNAL:
      • isEmpty

        public boolean isEmpty()
        PUBLIC: Return if the row is empty.
        Specified by:
        isEmpty in interface java.util.Map
      • hasNullValueInFields

        public boolean hasNullValueInFields()
        INTERNAL: Return true if the AbstractRecord has been marked as valid to check the update call cache with, false otherwise.
      • keys

        public java.util.Enumeration keys()
        PUBLIC: Returns an Enumeration of the DatabaseField objects.
      • keySet

        public java.util.Set keySet()
        PUBLIC: Returns a set of the keys.
        Specified by:
        keySet in interface java.util.Map
      • mergeFrom

        public void mergeFrom​(AbstractRecord row)
        INTERNAL: Merge the provided row into this row. Existing field values in this row will be replaced with values from the provided row. Fields not in this row will be added from provided row. Values not in provided row will remain in this row.
      • put

        public java.lang.Object put​(java.lang.Object key,
                                    java.lang.Object value)
                             throws ValidationException
        PUBLIC: Add the field-value pair to the row.
        Specified by:
        put in interface java.util.Map
        Throws:
        ValidationException
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object value)
        PUBLIC: Add the field-value pair to the row.
      • put

        public java.lang.Object put​(DatabaseField key,
                                    java.lang.Object value)
        INTERNAL: Add the field-value pair to the row.
      • putAll

        public void putAll​(java.util.Map map)
        PUBLIC: Add all of the elements.
        Specified by:
        putAll in interface java.util.Map
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        INTERNAL: Remove the field key from the row.
        Specified by:
        remove in interface java.util.Map
      • remove

        public java.lang.Object remove​(java.lang.String fieldName)
        INTERNAL: Remove the field key from the row.
      • remove

        public java.lang.Object remove​(DatabaseField key)
        INTERNAL: Remove the field key from the row.
      • replaceAt

        public void replaceAt​(java.lang.Object value,
                              int index)
        INTERNAL: replaces the value at index with value
      • replaceAt

        public void replaceAt​(java.lang.Object value,
                              DatabaseField key)
        INTERNAL: replaces the value at field with value
      • setFields

        protected void setFields​(java.util.Vector fields)
      • setNullValueInFields

        public void setNullValueInFields​(boolean nullValueInFields)
        INTERNAL: Set the validForUpdateCallCacheCheck attribute to true if the row does not contain nulls, false otherwise
      • setValues

        protected void setValues​(java.util.Vector values)
      • size

        public int size()
        PUBLIC: Return the number of field/value pairs in the row.
        Specified by:
        size in interface java.util.Map
      • toString

        public java.lang.String toString()
        INTERNAL:
        Overrides:
        toString in class java.lang.Object
      • values

        public java.util.Collection values()
        PUBLIC: Returns an collection of the values.
        Specified by:
        values in interface java.util.Map
      • hasSopObject

        public boolean hasSopObject()
        INTERNAL:
      • getSopObject

        public java.lang.Object getSopObject()
        INTERNAL:
      • setSopObject

        public void setSopObject​(java.lang.Object sopObject)
        INTERNAL: