Oracle ADF Model and Business Components API Reference 10.1.2 B14022-02


oracle.jbo
Class NameValuePairs

java.lang.Object
  extended byoracle.jbo.NameValuePairs

All Implemented Interfaces:
AttributeList
Direct Known Subclasses:
AttributeListImpl

public class NameValuePairs
extends java.lang.Object
implements AttributeList

Holder of name/value pairs.

This class provides methods for setting and getting values either by index or by name.


Constructor Summary
NameValuePairs()
Creates an empty attribute list.
NameValuePairs(int size)
Constructs a new attribute list with a specified initial capacity.
NameValuePairs(java.lang.String[] nameArr, java.lang.Object[] valArr)

Method Summary
void clear()
java.lang.Object getAttribute(int index)
Gets the value of an attribute identified by its index.
java.lang.Object getAttribute(java.lang.String name)
Gets the value of an attribute identified by name.
int getAttributeCount()
Counts the attributes.
int getAttributeIndexOf(java.lang.String name)
Gets the index of a named attribute.
java.lang.String[] getAttributeNames()
Returns an array of attribute names in this list.
java.lang.Object[] getAttributeValues()
Returns an array of attribute values in this list.
void setAttribute(int index, java.lang.Object value)
Sets the value for the specified attribute.
void setAttribute(java.lang.String name, java.lang.Object value)
Sets the value for the named attribute.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NameValuePairs

public NameValuePairs()
Creates an empty attribute list.

NameValuePairs

public NameValuePairs(int size)
Constructs a new attribute list with a specified initial capacity.
Parameters:
size - the initial cacpacity.

NameValuePairs

public NameValuePairs(java.lang.String[] nameArr,
                      java.lang.Object[] valArr)

Method Detail

getAttribute

public java.lang.Object getAttribute(int index)
Gets the value of an attribute identified by its index.
Specified by:
getAttribute in interface AttributeList
Parameters:
index - the attribute's index.
Returns:
the value of the attribute, or null if index is out of range.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Gets the value of an attribute identified by name.
Specified by:
getAttribute in interface AttributeList
Parameters:
name - the attribute's name.
Returns:
the value of the attribute, or null if index is out of range.

setAttribute

public void setAttribute(int index,
                         java.lang.Object value)
Sets the value for the specified attribute.
Specified by:
setAttribute in interface AttributeList
Parameters:
index - the attribute index.
value - the attribute's new value.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Sets the value for the named attribute.
Specified by:
setAttribute in interface AttributeList
Parameters:
name - the attribute name.
value - the attribute's new value.

getAttributeCount

public int getAttributeCount()
Counts the attributes.
Specified by:
getAttributeCount in interface AttributeList
Returns:
the number of attributes.

getAttributeIndexOf

public int getAttributeIndexOf(java.lang.String name)
Gets the index of a named attribute.
Specified by:
getAttributeIndexOf in interface AttributeList
Parameters:
name - the attribute's name.
Returns:
the attribute's index, or -1 if not found.

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from interface: AttributeList
Returns an array of attribute names in this list.
Specified by:
getAttributeNames in interface AttributeList
Returns:
an array of attribute names.

getAttributeValues

public java.lang.Object[] getAttributeValues()
Description copied from interface: AttributeList
Returns an array of attribute values in this list.
Specified by:
getAttributeValues in interface AttributeList
Returns:
an array of attribute values.

clear

public void clear()

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-02


Copyright © 1997, 2005, Oracle. All rights reserved.