Methods Summary |
---|
public void | add(oracle.toplink.essentials.internal.helper.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
getFields().addElement(key);
getValues().addElement(value);
|
public void | clear()PUBLIC:
Clear the contents of the row.
this.fields = new Vector();
this.values = new Vector();
|
public java.lang.Object | clone()INTERNAL:
Clone the row and its values.
try {
AbstractRecord clone = (AbstractRecord)super.clone();
clone.setFields((Vector)getFields().clone());
clone.setValues((Vector)getValues().clone());
return clone;
} catch (CloneNotSupportedException exception) {
}
return null;
|
public boolean | contains(java.lang.Object value)PUBLIC:
Check if the value is contained in the row.
return containsValue(value);
|
public boolean | containsKey(oracle.toplink.essentials.internal.helper.DatabaseField key)INTERNAL:
Check if the field is contained in the row.
// Optimize check.
int index = key.getIndex();
if ((index >= 0) && (index < getFields().size())) {
DatabaseField field = (DatabaseField)getFields().elementAt(index);
if ((field == key) || field.equals(key)) {
return true;
}
}
return getFields().contains(key);
|
public boolean | containsKey(java.lang.Object key)PUBLIC:
Check if the field is contained in the row.
Conform to hashtable interface.
if (key instanceof String) {
return containsKey((String)key);
}
if (key instanceof DatabaseField) {
return containsKey((DatabaseField)key);
}
return false;
|
public boolean | containsKey(java.lang.String fieldName)PUBLIC:
Check if the field is contained in the row.
// Optimized the field creation.
if (this.lookupField == null) {
this.lookupField = new DatabaseField(fieldName);
} else {
this.lookupField.resetQualifiedName(fieldName);
}
return containsKey(this.lookupField);
|
public boolean | containsValue(java.lang.Object value)PUBLIC:
Check if the value is contained in the row.
return getValues().contains(value);
|
public java.util.Enumeration | elements()PUBLIC:
Returns an Enumeration of the values.
return getValues().elements();
|
public java.util.Set | entrySet()PUBLIC:
Returns a set of the keys.
int size = this.size();
Map tempMap = new HashMap(size);
for (int i = 0; i < size; i++) {
tempMap.put(this.getFields().elementAt(i), this.getValues().elementAt(i));
}
return tempMap.entrySet();
|
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.
if (key instanceof String) {
return get((String)key);
} else if (key instanceof DatabaseField) {
return get((DatabaseField)key);
}
return null;
|
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.
Object value = getIndicatingNoEntry(fieldName);
if (value == oracle.toplink.essentials.internal.sessions.AbstractRecord.noEntry) {
return null;
}
return value;
|
public java.lang.Object | get(oracle.toplink.essentials.internal.helper.DatabaseField key)INTERNAL:
Retrieve the value for the field. If missing null is returned.
Object value = getIndicatingNoEntry(key);
if (value == oracle.toplink.essentials.internal.sessions.AbstractRecord.noEntry) {
return null;
}
return value;
|
public oracle.toplink.essentials.internal.helper.DatabaseField | getField(oracle.toplink.essentials.internal.helper.DatabaseField key)INTERNAL:
Returns the row's field with the same name.
// Optimize check.
int index = key.getIndex();
if ((index >= 0) && (index < getFields().size())) {
DatabaseField field = (DatabaseField)getFields().elementAt(index);
if ((field == key) || field.equals(key)) {
return field;
}
}
for (index = 0; index < getFields().size(); index++) {
DatabaseField field = (DatabaseField)getFields().elementAt(index);
if ((field == key) || field.equals(key)) {
return field;
}
}
return null;
|
public java.util.Vector | getFields()INTERNAL:
return fields;
|
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.
// Optimized the field creation.
if (this.lookupField == null) {
this.lookupField = new DatabaseField(fieldName);
} else {
this.lookupField.resetQualifiedName(fieldName);
}
return getIndicatingNoEntry(this.lookupField);
|
public java.lang.Object | getIndicatingNoEntry(oracle.toplink.essentials.internal.helper.DatabaseField key)INTERNAL:
Retrieve the value for the field. If missing DatabaseRow.noEntry is returned.
// PERF: Direct variable access.
// Optimize check.
int index = key.getIndex();
if ((index >= 0) && (index < this.fields.size())) {
DatabaseField field = (DatabaseField)this.fields.elementAt(index);
if ((field == key) || field.equals(key)) {
return this.values.elementAt(index);
}
}
index = this.fields.indexOf(key);
if (index >= 0) {
// PERF: If the fields index was not set, then set it.
if (key.getIndex() == -1) {
key.setIndex(index);
}
return this.values.elementAt(index);
} else {
return oracle.toplink.essentials.internal.sessions.AbstractRecord.noEntry;
}
|
public java.lang.Object | getValues(oracle.toplink.essentials.internal.helper.DatabaseField key)
return get(key);
|
public java.lang.Object | getValues(java.lang.String key)
return get(key);
|
public java.util.Vector | getValues()INTERNAL:
return values;
|
public boolean | isEmpty()PUBLIC:
Return if the row is empty.
return size() == 0;
|
public java.util.Set | keySet()PUBLIC:
Returns a set of the keys.
return new HashSet(getFields());
|
public java.util.Enumeration | keys()PUBLIC:
Returns an Enumeration of the DatabaseField objects.
return getFields().elements();
|
public void | mergeFrom(oracle.toplink.essentials.internal.sessions.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.
for (int index = 0; index < row.size(); ++index){
this.put(row.getFields().get(index), row.getValues().get(index));
}
|
public java.lang.Object | put(java.lang.Object key, java.lang.Object value)PUBLIC:
Add the field-value pair to the row.
if (key instanceof String) {
return put((String)key, value);
} else if (key instanceof DatabaseField) {
return put((DatabaseField)key, value);
} else {
throw ValidationException.onlyFieldsAreValidKeysForDatabaseRows();
}
|
public java.lang.Object | put(java.lang.String key, java.lang.Object value)PUBLIC:
Add the field-value pair to the row.
return put(new DatabaseField(key), value);
|
public java.lang.Object | put(oracle.toplink.essentials.internal.helper.DatabaseField key, java.lang.Object value)INTERNAL:
Add the field-value pair to the row.
int index = getFields().indexOf(key);
if (index >= 0) {
Object oldValue = getValues().elementAt(index);
replaceAt(value, index);
return oldValue;
} else {
add(key, value);
}
return null;
|
public void | putAll(java.util.Map map)PUBLIC:
Add all of the elements.
Iterator entriesIterator = map.entrySet().iterator();
while (entriesIterator.hasNext()) {
Map.Entry entry = (Map.Entry)entriesIterator.next();
put(entry.getKey(), entry.getValue());
}
|
public java.lang.Object | remove(java.lang.Object key)INTERNAL:
Remove the field key from the row.
if (key instanceof String) {
return remove((String)key);
} else if (key instanceof DatabaseField) {
return remove((DatabaseField)key);
}
return null;
|
public java.lang.Object | remove(java.lang.String fieldName)INTERNAL:
Remove the field key from the row.
return remove(new DatabaseField(fieldName));
|
public java.lang.Object | remove(oracle.toplink.essentials.internal.helper.DatabaseField key)INTERNAL:
Remove the field key from the row.
int index = getFields().indexOf(key);
if (index >= 0) {
getFields().removeElementAt(index);
Object value = getValues().elementAt(index);
getValues().removeElementAt(index);
return value;
}
return null;
|
public void | replaceAt(java.lang.Object value, int index)INTERNAL:
replaces the value at index with value
getValues().setElementAt(value, index);
|
protected void | setFields(java.util.Vector fields)
this.fields = fields;
|
protected void | setValues(java.util.Vector values)
this.values = values;
|
public int | size()PUBLIC:
Return the number of field/value pairs in the row.
return getFields().size();
|
public java.lang.String | toString()INTERNAL:
StringWriter writer = new StringWriter();
writer.write(Helper.getShortClassName(getClass()));
writer.write("(");
for (int index = 0; index < getFields().size(); index++) {
writer.write(Helper.cr());
writer.write("\t");
writer.write(String.valueOf((getFields().elementAt(index))));
writer.write(" => ");
writer.write(String.valueOf((getValues().elementAt(index))));
}
writer.write(")");
return writer.toString();
|
public java.util.Collection | values()PUBLIC:
Returns an collection of the values.
return getValues();
|