Package com.ibm.websphere.ola
Class IndexedRecordImpl
- java.lang.Object
-
- com.ibm.websphere.ola.IndexedRecordImpl
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List,javax.resource.cci.IndexedRecord,javax.resource.cci.Record
public class IndexedRecordImpl extends java.lang.Object implements javax.resource.cci.IndexedRecordImplementation of the IndexedRecord interface used by the Optimized Local Adapter (OLA). This implementation should be obtained through the RecordFactory provided by the cci.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IndexedRecordImpl()Public, general purpose constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, java.lang.Object o)Adds an element to the record.booleanadd(java.lang.Object o)Adds an element to the record.booleanaddAll(int index, java.util.Collection c)Adds all the elements of the collection to the record at the specified index.booleanaddAll(java.util.Collection c)Adds all of the elements of the collection to the record.voidclear()Clears the record of all data.java.lang.Objectclone()Makes a copy of the list.booleancontains(java.lang.Object o)Searches the record for the specified entry.booleancontainsAll(java.util.Collection c)Searches the record for the specified entrys.java.lang.Objectget(int index)Retrieves an object from the record at the specified index.java.lang.StringgetRecordName()Gets the record name (created by the client)java.lang.StringgetRecordShortDescription()Gets the descriptionintindexOf(java.lang.Object o)Gets the index of a particular entry.booleanisEmpty()Checks to see if the record is emptyjava.util.Iteratoriterator()Gets an iterator over the recordsintlastIndexOf(java.lang.Object o)Gets the last index of a particular entry.java.util.ListIteratorlistIterator()Gets a list iterator over the records.java.util.ListIteratorlistIterator(int index)Gets a list iterator starting at the specified index.java.lang.Objectremove(int index)Removes a specified element from the list, based on index.booleanremove(java.lang.Object o)Removes an object from the list.booleanremoveAll(java.util.Collection c)Removes all members of the specified collection.booleanretainAll(java.util.Collection c)This operation is not supported.java.lang.Objectset(int index, java.lang.Object o)Sets an element at a given index.voidsetRecordName(java.lang.String arg0)Sets the record namevoidsetRecordShortDescription(java.lang.String arg0)Sets the descriptionintsize()Returns the size of the record (number of elements).java.util.ListsubList(int fromIndex, int toIndex)Returns a portion of the record, as a list.java.lang.Object[]toArray()Creates an array of byte[] objects representing the elements of this record.java.lang.Object[]toArray(java.lang.Object[] a)Returns an array of byte[] objects.
-
-
-
Method Detail
-
getRecordName
public java.lang.String getRecordName()
Gets the record name (created by the client)- Specified by:
getRecordNamein interfacejavax.resource.cci.Record- Returns:
- The name of the record
-
getRecordShortDescription
public java.lang.String getRecordShortDescription()
Gets the description- Specified by:
getRecordShortDescriptionin interfacejavax.resource.cci.Record- Returns:
- The description
-
setRecordName
public void setRecordName(java.lang.String arg0)
Sets the record name- Specified by:
setRecordNamein interfacejavax.resource.cci.Record- Parameters:
arg0- The name of the record
-
setRecordShortDescription
public void setRecordShortDescription(java.lang.String arg0)
Sets the description- Specified by:
setRecordShortDescriptionin interfacejavax.resource.cci.Record- Parameters:
arg0- The description of the record
-
add
public boolean add(java.lang.Object o)
Adds an element to the record. The element can be a byte[] or can be a Record instance created by the RAD or RD/z tooling. The element is added at the end of the list.- Specified by:
addin interfacejava.util.Collection- Specified by:
addin interfacejava.util.List- Parameters:
o- The record or byte[] to add.- Returns:
- true if the record was added successfully
-
add
public void add(int index, java.lang.Object o)Adds an element to the record. The element can be a byte[] or can be a Record instance created by the RAD or RD/z tooling. The element is added at the specified index, as per the java.util.List contract.- Specified by:
addin interfacejava.util.List- Parameters:
index- The index at which to add the objecto- The byte[] or Record to insert
-
addAll
public boolean addAll(java.util.Collection c)
Adds all of the elements of the collection to the record.- Specified by:
addAllin interfacejava.util.Collection- Specified by:
addAllin interfacejava.util.List- Parameters:
c- The collection of objects to add.- Returns:
- true if the collection was added successfully
-
addAll
public boolean addAll(int index, java.util.Collection c)Adds all the elements of the collection to the record at the specified index.- Specified by:
addAllin interfacejava.util.List- Parameters:
index- The index at which to add the collectionc- The collection of objects to add- Returns:
- true if the add was successful
-
clear
public void clear()
Clears the record of all data.- Specified by:
clearin interfacejava.util.Collection- Specified by:
clearin interfacejava.util.List
-
contains
public boolean contains(java.lang.Object o)
Searches the record for the specified entry. The binary data (either the byte[] or the data within the Record objects) are used to compare the entries, and thus this is an expensive operation. Null entries are not allowed and will never be matched.- Specified by:
containsin interfacejava.util.Collection- Specified by:
containsin interfacejava.util.List- Parameters:
o- The object for which to check- Returns:
- true if the object was found
-
containsAll
public boolean containsAll(java.util.Collection c)
Searches the record for the specified entrys. The binary data (either the byte[] or the data within the Record objects) are used to compare the entries, and thus this is an expensive operation. Null entries are not allowed and will never be matched.- Specified by:
containsAllin interfacejava.util.Collection- Specified by:
containsAllin interfacejava.util.List- Parameters:
c- The collection of objects to search for- Returns:
- true if all the objects were found
-
get
public java.lang.Object get(int index)
Retrieves an object from the record at the specified index.- Specified by:
getin interfacejava.util.List- Parameters:
index- The index at which to get the object- Returns:
- The object
-
indexOf
public int indexOf(java.lang.Object o)
Gets the index of a particular entry. The byte[] representation of the object is used to compare for equality.- Specified by:
indexOfin interfacejava.util.List- Parameters:
o- The object to search for- Returns:
- The index of the object, or -1 if not found.
-
isEmpty
public boolean isEmpty()
Checks to see if the record is empty- Specified by:
isEmptyin interfacejava.util.Collection- Specified by:
isEmptyin interfacejava.util.List- Returns:
- true if the record is empty
-
iterator
public java.util.Iterator iterator()
Gets an iterator over the records- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.lang.Iterable- Specified by:
iteratorin interfacejava.util.List- Returns:
- An iterator over the records within this indexed record
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
Gets the last index of a particular entry. The byte[] representation of the object is used to compare for equality.- Specified by:
lastIndexOfin interfacejava.util.List- Parameters:
o- The object to search for- Returns:
- The index of the object, or -1 if not found.
-
listIterator
public java.util.ListIterator listIterator()
Gets a list iterator over the records. The records returned in the iterator are in their raw serialized form (byte[]).- Specified by:
listIteratorin interfacejava.util.List- Returns:
- A ListIterator over the records within this indexed record.
-
listIterator
public java.util.ListIterator listIterator(int index)
Gets a list iterator starting at the specified index. The records returned in the iterator are in their raw serialized form (byte[]).- Specified by:
listIteratorin interfacejava.util.List- Returns:
- A ListIterator over the records within this indexed record.
-
remove
public boolean remove(java.lang.Object o)
Removes an object from the list. The raw byte[] version of the object is used to find the correct element.- Specified by:
removein interfacejava.util.Collection- Specified by:
removein interfacejava.util.List- Parameters:
o- The object to remove- Returns:
- true if the object was found and removed.
-
remove
public java.lang.Object remove(int index)
Removes a specified element from the list, based on index. If removed, the object returned represents the raw serialized form (byte[]) of the object.- Specified by:
removein interfacejava.util.List- Parameters:
index- The index that should be removed- Returns:
- The object instance that was removed.
-
removeAll
public boolean removeAll(java.util.Collection c)
Removes all members of the specified collection. The raw serialized (byte[]) version of the elements are used to perform the comparison.- Specified by:
removeAllin interfacejava.util.Collection- Specified by:
removeAllin interfacejava.util.List- Parameters:
c- The collection of objects to remove.- Returns:
- true if all the object in the collection were removed.
-
retainAll
public boolean retainAll(java.util.Collection c)
This operation is not supported.- Specified by:
retainAllin interfacejava.util.Collection- Specified by:
retainAllin interfacejava.util.List- Throws:
java.lang.UnsupportedOperationException
-
set
public java.lang.Object set(int index, java.lang.Object o)Sets an element at a given index. The object at that element (if any) is returned. The byte[] representation of the object is returned, regardless of what type of item was used to set it initially.- Specified by:
setin interfacejava.util.List- Parameters:
index- The index at which to set the objecto- The object to set- Returns:
- The object which was previously at the given index. The object is returned in byte[] form.
-
size
public int size()
Returns the size of the record (number of elements).- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein interfacejava.util.List- Returns:
- The number of elements in this indexed record
-
subList
public java.util.List subList(int fromIndex, int toIndex)Returns a portion of the record, as a list. The list elements represent the byte[] versions of the data.- Specified by:
subListin interfacejava.util.List- Parameters:
fromIndex- The index from which to starttoIndex- The index at which to end- Returns:
- A List spanning the two indexes.
-
toArray
public java.lang.Object[] toArray()
Creates an array of byte[] objects representing the elements of this record.- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.List- Returns:
- The objects in this indexed record, as an array of Objects.
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
Returns an array of byte[] objects. The input array must be of type byte[][].- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.List- Parameters:
a- An array of byte[] objects to be filled in.- Returns:
- The array of objects in byte[] form.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionMakes a copy of the list.- Specified by:
clonein interfacejavax.resource.cci.Record- Returns:
- A copy of this indexed record.
- Throws:
java.lang.CloneNotSupportedException
-
-