public abstract class AbstractRecord extends Object implements Record, Cloneable, Serializable, 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 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 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(Vector fields,
Vector values)
INTERNAL:
TopLink converts JDBC results to collections of rows.
|
Modifier and Type | Method and Description |
---|---|
void |
add(DatabaseField key,
Object value)
INTERNAL:
Add the field-value pair to the row.
|
void |
clear()
PUBLIC:
Clear the contents of the row.
|
Object |
clone()
INTERNAL:
Clone the row and its values.
|
boolean |
contains(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(Object key)
PUBLIC:
Check if the field is contained in the row.
|
boolean |
containsKey(String fieldName)
PUBLIC:
Check if the field is contained in the row.
|
boolean |
containsValue(Object value)
PUBLIC:
Check if the value is contained in the row.
|
Enumeration |
elements()
PUBLIC:
Returns an Enumeration of the values.
|
Set |
entrySet()
PUBLIC:
Returns a set of the keys.
|
Object |
get(DatabaseField key)
INTERNAL:
Retrieve the value for the field.
|
Object |
get(Object key)
PUBLIC:
Retrieve the value for the field name.
|
Object |
get(String fieldName)
PUBLIC:
Retrieve the value for the field name.
|
DatabaseField |
getField(DatabaseField key)
INTERNAL:
Returns the row's field with the same name.
|
Vector |
getFields()
INTERNAL:
|
Object |
getIndicatingNoEntry(DatabaseField key)
INTERNAL:
Retrieve the value for the field.
|
Object |
getIndicatingNoEntry(String fieldName)
PUBLIC:
Retrieve the value for the field name.
|
Vector |
getValues()
INTERNAL:
|
Object |
getValues(DatabaseField key) |
Object |
getValues(String key) |
boolean |
isEmpty()
PUBLIC:
Return if the row is empty.
|
Enumeration |
keys()
PUBLIC:
Returns an Enumeration of the DatabaseField objects.
|
Set |
keySet()
PUBLIC:
Returns a set of the keys.
|
void |
mergeFrom(AbstractRecord row)
INTERNAL:
Merge the provided row into this row.
|
Object |
put(DatabaseField key,
Object value)
INTERNAL:
Add the field-value pair to the row.
|
Object |
put(Object key,
Object value)
PUBLIC:
Add the field-value pair to the row.
|
Object |
put(String key,
Object value)
PUBLIC:
Add the field-value pair to the row.
|
void |
putAll(Map map)
PUBLIC:
Add all of the elements.
|
Object |
remove(DatabaseField key)
INTERNAL:
Remove the field key from the row.
|
Object |
remove(Object key)
INTERNAL:
Remove the field key from the row.
|
Object |
remove(String fieldName)
INTERNAL:
Remove the field key from the row.
|
void |
replaceAt(Object value,
int index)
INTERNAL:
replaces the value at index with value
|
protected void |
setFields(Vector fields) |
protected void |
setValues(Vector values) |
int |
size()
PUBLIC:
Return the number of field/value pairs in the row.
|
String |
toString()
INTERNAL:
|
Collection |
values()
PUBLIC:
Returns an collection of the values.
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
protected Vector fields
protected Vector values
protected DatabaseField lookupField
public static AbstractRecord.NoEntry noEntry
public AbstractRecord()
public AbstractRecord(int initialCapacity)
public void add(DatabaseField key, Object value)
public void clear()
public Object clone()
public boolean contains(Object value)
public boolean containsKey(Object key)
containsKey
in interface Map
public boolean containsKey(String fieldName)
public boolean containsKey(DatabaseField key)
public boolean containsValue(Object value)
containsValue
in interface Map
public Enumeration elements()
public Set entrySet()
public Object get(Object key)
public Object get(String fieldName)
public Object getIndicatingNoEntry(String fieldName)
public Object get(DatabaseField key)
public Object getValues(DatabaseField key)
public Object getIndicatingNoEntry(DatabaseField key)
public DatabaseField getField(DatabaseField key)
public Vector getFields()
public Vector getValues()
public boolean isEmpty()
public Enumeration keys()
public void mergeFrom(AbstractRecord row)
public Object put(Object key, Object value) throws ValidationException
put
in interface Map
ValidationException
public Object put(DatabaseField key, Object value)
public void putAll(Map map)
public Object remove(DatabaseField key)
public void replaceAt(Object value, int index)
protected void setFields(Vector fields)
protected void setValues(Vector values)
public int size()
public Collection values()
Copyright © 2024. All rights reserved.