com.ibm.websphere.ola

Class IndexedRecordImpl

  1. java.lang.Object
  2. extended bycom.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

  1. public class IndexedRecordImpl
  2. extends java.lang.Object
  3. implements javax.resource.cci.IndexedRecord
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:
Serialized Form

Constructor Summary

Constructor and Description
IndexedRecordImpl()
Public, general purpose constructor

Method Summary

Modifier and Type Method and Description
  1. void
add(int index,java.lang.Object o)
Adds an element to the record.
  1. boolean
add(java.lang.Object o)
Adds an element to the record.
  1. boolean
addAll(java.util.Collection c)
Adds all of the elements of the collection to the record.
  1. boolean
addAll(int index,java.util.Collection c)
Adds all the elements of the collection to the record at the specified index.
  1. void
clear()
Clears the record of all data.
  1. java.lang.Object
clone()
Makes a copy of the list.
  1. boolean
contains(java.lang.Object o)
Searches the record for the specified entry.
  1. boolean
containsAll(java.util.Collection c)
Searches the record for the specified entrys.
  1. java.lang.Object
get(int index)
Retrieves an object from the record at the specified index.
  1. java.lang.String
getRecordName()
Gets the record name (created by the client)
  1. java.lang.String
getRecordShortDescription()
Gets the description
  1. int
indexOf(java.lang.Object o)
Gets the index of a particular entry.
  1. boolean
isEmpty()
Checks to see if the record is empty
  1. java.util.Iterator
iterator()
Gets an iterator over the records
  1. int
lastIndexOf(java.lang.Object o)
Gets the last index of a particular entry.
  1. java.util.ListIterator
listIterator()
Gets a list iterator over the records.
  1. java.util.ListIterator
listIterator(int index)
Gets a list iterator starting at the specified index.
  1. java.lang.Object
remove(int index)
Removes a specified element from the list, based on index.
  1. boolean
remove(java.lang.Object o)
Removes an object from the list.
  1. boolean
removeAll(java.util.Collection c)
Removes all members of the specified collection.
  1. boolean
retainAll(java.util.Collection c)
This operation is not supported.
  1. java.lang.Object
set(int index,java.lang.Object o)
Sets an element at a given index.
  1. void
setRecordName(java.lang.String arg0)
Sets the record name
  1. void
setRecordShortDescription(java.lang.String arg0)
Sets the description
  1. int
size()
Returns the size of the record (number of elements).
  1. java.util.List
subList(int fromIndex,int toIndex)
Returns a portion of the record, as a list.
  1. java.lang.Object[]
toArray()
Creates an array of byte[] objects representing the elements of this record.
  1. java.lang.Object[]
toArray(java.lang.Object[] a)
Returns an array of byte[] objects.
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.resource.cci.Record
equals, hashCode
Methods inherited from interface java.util.List
equals, hashCode

Constructor Detail

IndexedRecordImpl

  1. public IndexedRecordImpl()
Public, general purpose constructor

Method Detail

getRecordName

  1. public java.lang.String getRecordName( )
Gets the record name (created by the client)
Specified by:
getRecordName in interface javax.resource.cci.Record
Returns:
The name of the record

getRecordShortDescription

  1. public java.lang.String getRecordShortDescription( )
Gets the description
Specified by:
getRecordShortDescription in interface javax.resource.cci.Record
Returns:
The description

setRecordName

  1. public void setRecordName(java.lang.String arg0)
Sets the record name
Specified by:
setRecordName in interface javax.resource.cci.Record
Parameters:
arg0 - The name of the record

setRecordShortDescription

  1. public void setRecordShortDescription( java.lang.String arg0)
Sets the description
Specified by:
setRecordShortDescription in interface javax.resource.cci.Record
Parameters:
arg0 - The description of the record

add

  1. 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:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Parameters:
o - The record or byte[] to add.
Returns:
true if the record was added successfully

add

  1. public void add(int index,
  2. 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:
add in interface java.util.List
Parameters:
index - The index at which to add the object
o - The byte[] or Record to insert

addAll

  1. public boolean addAll(java.util.Collection c)
Adds all of the elements of the collection to the record.
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Parameters:
c - The collection of objects to add.
Returns:
true if the collection was added successfully

addAll

  1. public boolean addAll(int index,
  2. java.util.Collection c)
Adds all the elements of the collection to the record at the specified index.
Specified by:
addAll in interface java.util.List
Parameters:
index - The index at which to add the collection
c - The collection of objects to add
Returns:
true if the add was successful

clear

  1. public void clear()
Clears the record of all data.
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List

contains

  1. 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:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List
Parameters:
o - The object for which to check
Returns:
true if the object was found

containsAll

  1. 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:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List
Parameters:
c - The collection of objects to search for
Returns:
true if all the objects were found

get

  1. public java.lang.Object get(int index)
Retrieves an object from the record at the specified index.
Specified by:
get in interface java.util.List
Parameters:
index - The index at which to get the object
Returns:
The object

indexOf

  1. 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:
indexOf in interface java.util.List
Parameters:
o - The object to search for
Returns:
The index of the object, or -1 if not found.

isEmpty

  1. public boolean isEmpty()
Checks to see if the record is empty
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List
Returns:
true if the record is empty

iterator

  1. public java.util.Iterator iterator( )
Gets an iterator over the records
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List
Returns:
An iterator over the records within this indexed record

lastIndexOf

  1. 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:
lastIndexOf in interface java.util.List
Parameters:
o - The object to search for
Returns:
The index of the object, or -1 if not found.

listIterator

  1. 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:
listIterator in interface java.util.List
Returns:
A ListIterator over the records within this indexed record.

listIterator

  1. 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:
listIterator in interface java.util.List
Returns:
A ListIterator over the records within this indexed record.

remove

  1. 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:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List
Parameters:
o - The object to remove
Returns:
true if the object was found and removed.

remove

  1. 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:
remove in interface java.util.List
Parameters:
index - The index that should be removed
Returns:
The object instance that was removed.

removeAll

  1. 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:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List
Parameters:
c - The collection of objects to remove.
Returns:
true if all the object in the collection were removed.

retainAll

  1. public boolean retainAll(java.util.Collection c)
This operation is not supported.
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List
Throws:
java.lang.UnsupportedOperationException

set

  1. public java.lang.Object set(int index,
  2. 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:
set in interface java.util.List
Parameters:
index - The index at which to set the object
o - The object to set
Returns:
The object which was previously at the given index. The object is returned in byte[] form.

size

  1. public int size()
Returns the size of the record (number of elements).
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Returns:
The number of elements in this indexed record

subList

  1. public java.util.List subList(int fromIndex,
  2. int toIndex)
Returns a portion of the record, as a list. The list elements represent the byte[] versions of the data.
Specified by:
subList in interface java.util.List
Parameters:
fromIndex - The index from which to start
toIndex - The index at which to end
Returns:
A List spanning the two indexes.

toArray

  1. public java.lang.Object[] toArray( )
Creates an array of byte[] objects representing the elements of this record.
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Returns:
The objects in this indexed record, as an array of Objects.

toArray

  1. 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:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Parameters:
a - An array of byte[] objects to be filled in.
Returns:
The array of objects in byte[] form.

clone

  1. public java.lang.Object clone()
  2. throws java.lang.CloneNotSupportedException
Makes a copy of the list.
Specified by:
clone in interface javax.resource.cci.Record
Overrides:
clone in class java.lang.Object
Returns:
A copy of this indexed record.
Throws:
java.lang.CloneNotSupportedException