Package com.ibm.websphere.ola
Class IndexedRecordImpl
java.lang.Object
com.ibm.websphere.ola.IndexedRecordImpl
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,List,javax.resource.cci.IndexedRecord,javax.resource.cci.Record
Implementation 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an element to the record.booleanAdds an element to the record.booleanaddAll(int index, Collection c) Adds all the elements of the collection to the record at the specified index.booleanaddAll(Collection c) Adds all of the elements of the collection to the record.voidclear()Clears the record of all data.clone()Makes a copy of the list.booleanSearches the record for the specified entry.booleanSearches the record for the specified entrys.get(int index) Retrieves an object from the record at the specified index.Gets the record name (created by the client)Gets the descriptionintGets the index of a particular entry.booleanisEmpty()Checks to see if the record is emptyiterator()Gets an iterator over the recordsintGets the last index of a particular entry.Gets a list iterator over the records.listIterator(int index) Gets a list iterator starting at the specified index.remove(int index) Removes a specified element from the list, based on index.booleanRemoves an object from the list.booleanRemoves all members of the specified collection.booleanThis operation is not supported.Sets an element at a given index.voidsetRecordName(String arg0) Sets the record namevoidSets the descriptionintsize()Returns the size of the record (number of elements).subList(int fromIndex, int toIndex) Returns a portion of the record, as a list.Object[]toArray()Creates an array of byte[] objects representing the elements of this record.Object[]Returns an array of byte[] objects.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliteratorMethods inherited from interface javax.resource.cci.Record
equals, hashCode
-
Constructor Details
-
IndexedRecordImpl
public IndexedRecordImpl()Public, general purpose constructor
-
-
Method Details
-
getRecordName
Gets the record name (created by the client)- Specified by:
getRecordNamein interfacejavax.resource.cci.Record- Returns:
- The name of the record
-
getRecordShortDescription
Gets the description- Specified by:
getRecordShortDescriptionin interfacejavax.resource.cci.Record- Returns:
- The description
-
setRecordName
Sets the record name- Specified by:
setRecordNamein interfacejavax.resource.cci.Record- Parameters:
arg0- The name of the record
-
setRecordShortDescription
Sets the description- Specified by:
setRecordShortDescriptionin interfacejavax.resource.cci.Record- Parameters:
arg0- The description of the record
-
add
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 interfaceCollection- Specified by:
addin interfaceList- Parameters:
o- The record or byte[] to add.- Returns:
- true if the record was added successfully
-
add
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. -
addAll
Adds all of the elements of the collection to the record.- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceList- Parameters:
c- The collection of objects to add.- Returns:
- true if the collection was added successfully
-
addAll
Adds all the elements of the collection to the record at the specified index. -
clear
public void clear()Clears the record of all data.- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceList
-
contains
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 interfaceCollection- Specified by:
containsin interfaceList- Parameters:
o- The object for which to check- Returns:
- true if the object was found
-
containsAll
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 interfaceCollection- Specified by:
containsAllin interfaceList- Parameters:
c- The collection of objects to search for- Returns:
- true if all the objects were found
-
get
Retrieves an object from the record at the specified index. -
indexOf
Gets the index of a particular entry. The byte[] representation of the object is used to compare for equality. -
isEmpty
public boolean isEmpty()Checks to see if the record is empty- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceList- Returns:
- true if the record is empty
-
iterator
Gets an iterator over the records -
lastIndexOf
Gets the last index of a particular entry. The byte[] representation of the object is used to compare for equality.- Specified by:
lastIndexOfin interfaceList- Parameters:
o- The object to search for- Returns:
- The index of the object, or -1 if not found.
-
listIterator
Gets a list iterator over the records. The records returned in the iterator are in their raw serialized form (byte[]).- Specified by:
listIteratorin interfaceList- Returns:
- A ListIterator over the records within this indexed record.
-
listIterator
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 interfaceList- Returns:
- A ListIterator over the records within this indexed record.
-
remove
Removes an object from the list. The raw byte[] version of the object is used to find the correct element.- Specified by:
removein interfaceCollection- Specified by:
removein interfaceList- Parameters:
o- The object to remove- Returns:
- true if the object was found and removed.
-
remove
Removes a specified element from the list, based on index. If removed, the object returned represents the raw serialized form (byte[]) of the object. -
removeAll
Removes all members of the specified collection. The raw serialized (byte[]) version of the elements are used to perform the comparison.- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceList- Parameters:
c- The collection of objects to remove.- Returns:
- true if all the object in the collection were removed.
-
retainAll
This operation is not supported.- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceList- Throws:
UnsupportedOperationException
-
set
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. -
size
public int size()Returns the size of the record (number of elements).- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList- Returns:
- The number of elements in this indexed record
-
subList
Returns a portion of the record, as a list. The list elements represent the byte[] versions of the data. -
toArray
Creates an array of byte[] objects representing the elements of this record.- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- Returns:
- The objects in this indexed record, as an array of Objects.
-
toArray
Returns an array of byte[] objects. The input array must be of type byte[][].- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- Parameters:
a- An array of byte[] objects to be filled in.- Returns:
- The array of objects in byte[] form.
-
clone
Makes a copy of the list.- Specified by:
clonein interfacejavax.resource.cci.Record- Returns:
- A copy of this indexed record.
- Throws:
CloneNotSupportedException
-