Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sessions

public Class ArrayRecord

extends DatabaseRecord
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.sessions.ResultSetRecord
Imports
java.io.StringWriter, java.util.*, org.eclipse.persistence.internal.helper.*, org.eclipse.persistence.sessions.DatabaseRecord

PERF: Optimized record implementation using arrays instead of Vector. Currently only used when fetch rows from the database.

Field Summary

Modifier and TypeField and Description
protected DatabaseField[]
protected Object[]

Constructor Summary

AccessConstructor and Description
protected
public
ArrayRecord(Vector<E> fields, DatabaseField[] fieldsArray, Object[] valuesArray)

Method Summary

Modifier and TypeMethod and Description
public void
add(DatabaseField key, Object value)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.add.

INTERNAL: Add the field-value pair to the row.
protected void
checkValues()

Reset the fields and values from the arrays.

public void
clear()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.clear.

Implements java.util.Map.clear.

PUBLIC: Clear the contents of the row.
public AbstractRecord
clone()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.clone.

INTERNAL: Clone the row and its values.
public boolean
containsKey(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.containsKey.

INTERNAL: Check if the field is contained in the row.
public boolean
containsValue(Object
value whose presence in this map is to be tested
value
)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.containsValue.

Implements java.util.Map.containsValue.

PUBLIC: Check if the value is contained in the row.
public Object
get(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.get.

INTERNAL: Retrieve the value for the field.
public DatabaseField
getField(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.getField.

INTERNAL: Returns the row's field with the same name.
public Vector<E>
public Object
public Vector<E>
public Object
put(DatabaseField
key with which the specified value is to be associated
key
,
Object
value to be associated with the specified key
value
)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.put.

Implements java.util.Map.put.

INTERNAL: Add the field-value pair to the row.
public Object
remove(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.remove.

INTERNAL: Remove the field key from the row.
public void
replaceAt(Object value, int index)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.replaceAt.

INTERNAL: replaces the value at index with value
public void
replaceAt(Object value, DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.replaceAt.

INTERNAL: replaces the value at field with value
protected void
protected void
public int
size()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.size.

Implements java.util.Map.size.

PUBLIC: Return the number of field/value pairs in the row.
public String
protected String

Field Detail

fieldsArrayback to summary
protected DatabaseField[] fieldsArray
valuesArrayback to summary
protected Object[] valuesArray

Constructor Detail

ArrayRecordback to summary
protected ArrayRecord()
ArrayRecordback to summary
public ArrayRecord(Vector<E> fields, DatabaseField[] fieldsArray, Object[] valuesArray)

Method Detail

addback to summary
public void add(DatabaseField key, Object value)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.add.

INTERNAL: Add the field-value pair to the row. Will not check, will simply add to the end of the row

Annotations
@Override
checkValuesback to summary
protected void checkValues()

Reset the fields and values from the arrays. This removes the optimization if a non-optimized method is called.

clearback to summary
public void clear()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.clear.

Implements java.util.Map.clear.

PUBLIC: Clear the contents of the row.

Annotations
@Override
cloneback to summary
public AbstractRecord clone()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.clone.

INTERNAL: Clone the row and its values.

Returns:AbstractRecord

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
containsKeyback to summary
public boolean containsKey(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.containsKey.

INTERNAL: Check if the field is contained in the row.

Annotations
@Override
containsValueback to summary
public boolean containsValue(Object value)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.containsValue.

Implements java.util.Map.containsValue.

PUBLIC: Check if the value is contained in the row.

Parameters
value:Object

Doc from java.util.Map.containsValue.

value whose presence in this map is to be tested

Returns:boolean

Doc from java.util.Map.containsValue.

true if this map maps one or more keys to the specified value

Annotations
@Override
getback to summary
public Object get(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.get.

INTERNAL: Retrieve the value for the field. If missing null is returned.

Annotations
@Override
getFieldback to summary
public DatabaseField getField(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.getField.

INTERNAL: Returns the row's field with the same name.

Annotations
@Override
getFieldsback to summary
public Vector<E> getFields()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.getFields.

INTERNAL:

Annotations
@Override
getIndicatingNoEntryback to summary
public Object getIndicatingNoEntry(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.getIndicatingNoEntry.

INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned.

Annotations
@Override
getValuesback to summary
public Vector<E> getValues()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.getValues.

INTERNAL:

Annotations
@Override
putback to summary
public Object put(DatabaseField key, Object value)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.put.

Implements java.util.Map.put.

INTERNAL: Add the field-value pair to the row.

Parameters
key:DatabaseField

Doc from java.util.Map.put.

key with which the specified value is to be associated

value:Object

Doc from java.util.Map.put.

value to be associated with the specified key

Returns:Object

Doc from java.util.Map.put.

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

Annotations
@Override
removeback to summary
public Object remove(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.remove.

INTERNAL: Remove the field key from the row.

Annotations
@Override
replaceAtback to summary
public void replaceAt(Object value, int index)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.replaceAt.

INTERNAL: replaces the value at index with value

Annotations
@Override
replaceAtback to summary
public void replaceAt(Object value, DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.replaceAt.

INTERNAL: replaces the value at field with value

Annotations
@Override
setFieldsback to summary
protected void setFields(Vector<E> fields)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.setFields.

Annotations
@Override
setValuesback to summary
protected void setValues(Vector<E> values)

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.setValues.

Annotations
@Override
sizeback to summary
public int size()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.size.

Implements java.util.Map.size.

PUBLIC: Return the number of field/value pairs in the row.

Returns:int

Doc from java.util.Map.size.

the number of key-value mappings in this map

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.persistence.internal.sessions.AbstractRecord.toString.

Doc from org.eclipse.persistence.internal.sessions.AbstractRecord.toString.

INTERNAL:

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override
toStringAditionalback to summary
protected String toStringAditional()