public class DatabaseRecord extends AbstractRecord
Purpose: Define a representation of a database row as field=>value pairs. This is the database row implementation class, the Record or java.util.Map interfaces should be used to access this class instead of the implemention class.
Responsibilities:
DatabaseField,
Record,
Map,
Serialized FormAbstractRecord.NoEntryfields, lookupField, noEntry, values| Constructor and Description |
|---|
DatabaseRecord()
INTERNAL:
Returns a record (of default size).
|
DatabaseRecord(int initialCapacity)
INTERNAL:
Returns a record of the given initial capacity.
|
DatabaseRecord(java.util.Vector fields,
java.util.Vector values)
INTERNAL:
Builds row from database result fields and values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
PUBLIC:
Clears the contents of the database row, both fields and values.
|
boolean |
contains(java.lang.Object value)
PUBLIC:
Checks if the given Object value is contained in the values held
in the database row.
|
boolean |
containsKey(java.lang.Object key)
PUBLIC:
Checks if a key (ie.
|
boolean |
containsKey(java.lang.String fieldName)
PUBLIC:
Checks if a given field is contained in the database row.
|
boolean |
containsValue(java.lang.Object value)
PUBLIC:
Checks if the given Object value is contained in the values held
in the database row.
|
java.util.Enumeration |
elements()
PUBLIC:
Returns an Enumeration of the values in the database row.
|
java.util.Set |
entrySet()
PUBLIC:
Returns a set of map entries (ie.
|
java.lang.Object |
get(java.lang.Object key)
PUBLIC:
Retrieves the value for the given key.
|
java.lang.Object |
get(java.lang.String fieldName)
PUBLIC:
Retrieves the value with the given name of the DatabaseField.
|
java.lang.Object |
getIndicatingNoEntry(java.lang.String fieldName)
PUBLIC:
Retrieves the value with the given field name.
|
java.lang.Object |
getValues(DatabaseField key)
PUBLIC:
Returns the Object associated with the given key
(null if the key does not map to an Object.)
|
java.lang.Object |
getValues(java.lang.String key)
PUBLIC:
Returns the Object associated with the given key
(null if the key does not map to an Object.)
|
boolean |
isEmpty()
PUBLIC:
Checks if the database row is empty (ie.
|
java.util.Enumeration |
keys()
PUBLIC:
Returns an Enumeration of the DatabaseField Objects.
|
java.util.Set |
keySet()
PUBLIC:
Returns a set of the keys, the DatabaseField Objects, for the database row.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
PUBLIC:
Adds a field-value pair to the row.
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
PUBLIC:
Adds a field-value pair to the row.
|
void |
putAll(java.util.Map map)
PUBLIC:
Adds all of the elements in the given map to the database row.
|
int |
size()
PUBLIC:
Returns the number of field-value pairs in the database row.
|
java.util.Collection |
values()
PUBLIC:
Returns a collection of the values held in the database row.
|
add, clone, containsKey, get, getField, getFields, getIndicatingNoEntry, getValues, mergeFrom, put, remove, remove, remove, replaceAt, setFields, setValues, toStringpublic DatabaseRecord()
public DatabaseRecord(int initialCapacity)
initialCapacity - public DatabaseRecord(java.util.Vector fields,
java.util.Vector values)
fields - Vector of fieldsvalues - Vector of valuespublic void clear()
clear in interface java.util.Mapclear in class AbstractRecordpublic boolean contains(java.lang.Object value)
contains in class AbstractRecordvalue - the Object to be consideredpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapcontainsKey in class AbstractRecordkey - an Object, either String or DatabaseFieldpublic boolean containsKey(java.lang.String fieldName)
containsKey in class AbstractRecordkey - String, the DatabaseField namepublic boolean containsValue(java.lang.Object value)
containsValue in interface java.util.MapcontainsValue in class AbstractRecordvalue - the Object under considerationpublic java.util.Enumeration elements()
elements in class AbstractRecordpublic java.util.Set entrySet()
entrySet in interface java.util.MapentrySet in class AbstractRecordMap.entrySet()public java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class AbstractRecordkey - Object, either String or DatabaseFieldpublic java.lang.Object get(java.lang.String fieldName)
get in class AbstractRecordfieldName - String, the DatabaseField namepublic java.lang.Object getIndicatingNoEntry(java.lang.String fieldName)
getIndicatingNoEntry in class AbstractRecordfieldName - String, the DatabaseField namepublic java.lang.Object getValues(DatabaseField key)
getValues in class AbstractRecordkey - DatabaseFieldpublic java.lang.Object getValues(java.lang.String key)
getValues in class AbstractRecordkey - Stringpublic boolean isEmpty()
isEmpty in interface java.util.MapisEmpty in class AbstractRecordpublic java.util.Enumeration keys()
keys in class AbstractRecordpublic java.util.Set keySet()
keySet in interface java.util.MapkeySet in class AbstractRecordpublic java.lang.Object put(java.lang.Object key,
java.lang.Object value)
throws ValidationException
put in interface java.util.Mapput in class AbstractRecordkey - Object, either String or DatabaseFieldvalue - ObjectValidationException - if inappropriate key is usedpublic java.lang.Object put(java.lang.String key,
java.lang.Object value)
put in class AbstractRecordkey - Stringvalue - Objectpublic void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in class AbstractRecordmap - Map of all the field-value elements to be addedpublic int size()
size in interface java.util.Mapsize in class AbstractRecordpublic java.util.Collection values()
values in interface java.util.Mapvalues in class AbstractRecord