public abstract class AbstractRecord extends java.lang.Object 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 Record interface. Subclasses are DatabaseRecord and XMLRecord.
Responsibilities:
DatabaseField
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
AbstractRecord.NoEntry
INTERNAL:
NoEntry: This is used to differentiate between the two kinds
of nulls: no entry exists, and the field is actually mapped
to null.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
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 java.util.Vector |
values
Use vector to store the fields/values for optimal performance.
|
Constructor and Description |
---|
AbstractRecord()
INTERNAL:
TopLink converts JDBC results to collections of rows.
|
AbstractRecord(int initialCapacity)
INTERNAL:
TopLink converts JDBC results to collections of rows.
|
AbstractRecord(java.util.Vector fields,
java.util.Vector values)
INTERNAL:
TopLink converts JDBC results to collections of rows.
|
Modifier and Type | Method and 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.
|
java.lang.Object |
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(DatabaseField key)
INTERNAL:
Check if the field 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 |
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(DatabaseField key)
INTERNAL:
Retrieve the value for the field.
|
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.
|
DatabaseField |
getField(DatabaseField key)
INTERNAL:
Returns the row's field with the same name.
|
java.util.Vector |
getFields()
INTERNAL:
|
java.lang.Object |
getIndicatingNoEntry(DatabaseField key)
INTERNAL:
Retrieve the value for the field.
|
java.lang.Object |
getIndicatingNoEntry(java.lang.String fieldName)
PUBLIC:
Retrieve the value for the field name.
|
java.util.Vector |
getValues()
INTERNAL:
|
java.lang.Object |
getValues(DatabaseField key) |
java.lang.Object |
getValues(java.lang.String key) |
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(DatabaseField key,
java.lang.Object value)
INTERNAL:
Add the field-value pair to the 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.
|
void |
putAll(java.util.Map map)
PUBLIC:
Add all of the elements.
|
java.lang.Object |
remove(DatabaseField key)
INTERNAL:
Remove the field key from the row.
|
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.
|
void |
replaceAt(java.lang.Object value,
int index)
INTERNAL:
replaces the value at index with value
|
protected void |
setFields(java.util.Vector fields) |
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.
|
protected java.util.Vector fields
protected java.util.Vector values
protected DatabaseField lookupField
public static AbstractRecord.NoEntry noEntry
public AbstractRecord()
public AbstractRecord(int initialCapacity)
public AbstractRecord(java.util.Vector fields, java.util.Vector values)
public void add(DatabaseField key, java.lang.Object value)
public void clear()
clear
in interface java.util.Map
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean contains(java.lang.Object value)
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsKey(java.lang.String fieldName)
public boolean containsKey(DatabaseField key)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public java.util.Enumeration elements()
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
public java.lang.Object get(java.lang.String fieldName)
public java.lang.Object getIndicatingNoEntry(java.lang.String fieldName)
public java.lang.Object get(DatabaseField key)
public java.lang.Object getValues(DatabaseField key)
public java.lang.Object getValues(java.lang.String key)
public java.lang.Object getIndicatingNoEntry(DatabaseField key)
public DatabaseField getField(DatabaseField key)
public java.util.Vector getFields()
public java.util.Vector getValues()
public boolean isEmpty()
isEmpty
in interface java.util.Map
public java.util.Enumeration keys()
public java.util.Set keySet()
keySet
in interface java.util.Map
public void mergeFrom(AbstractRecord row)
public java.lang.Object put(java.lang.Object key, java.lang.Object value) throws ValidationException
put
in interface java.util.Map
ValidationException
public java.lang.Object put(java.lang.String key, java.lang.Object value)
public java.lang.Object put(DatabaseField key, java.lang.Object value)
public void putAll(java.util.Map map)
putAll
in interface java.util.Map
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
public java.lang.Object remove(java.lang.String fieldName)
public java.lang.Object remove(DatabaseField key)
public void replaceAt(java.lang.Object value, int index)
protected void setFields(java.util.Vector fields)
protected void setValues(java.util.Vector values)
public int size()
size
in interface java.util.Map
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Collection values()
values
in interface java.util.Map