Class IndexedRecordImpl

java.lang.Object
com.ibm.websphere.ola.IndexedRecordImpl
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, jakarta.resource.cci.IndexedRecord, jakarta.resource.cci.Record

public class IndexedRecordImpl extends Object implements jakarta.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:
  • Constructor Details

    • IndexedRecordImpl

      public IndexedRecordImpl()
      Public, general purpose constructor
  • Method Details

    • getRecordName

      public String getRecordName()
      Gets the record name (created by the client)
      Specified by:
      getRecordName in interface jakarta.resource.cci.Record
      Returns:
      The name of the record
    • getRecordShortDescription

      public String getRecordShortDescription()
      Gets the description
      Specified by:
      getRecordShortDescription in interface jakarta.resource.cci.Record
      Returns:
      The description
    • setRecordName

      public void setRecordName(String arg0)
      Sets the record name
      Specified by:
      setRecordName in interface jakarta.resource.cci.Record
      Parameters:
      arg0 - The name of the record
    • setRecordShortDescription

      public void setRecordShortDescription(String arg0)
      Sets the description
      Specified by:
      setRecordShortDescription in interface jakarta.resource.cci.Record
      Parameters:
      arg0 - The description of the record
    • add

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

      public void add(int index, 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 List
      Parameters:
      index - The index at which to add the object
      o - The byte[] or Record to insert
    • addAll

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

      public boolean addAll(int index, Collection c)
      Adds all the elements of the collection to the record at the specified index.
      Specified by:
      addAll in interface 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

      public void clear()
      Clears the record of all data.
      Specified by:
      clear in interface Collection
      Specified by:
      clear in interface List
    • contains

      public boolean contains(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 Collection
      Specified by:
      contains in interface List
      Parameters:
      o - The object for which to check
      Returns:
      true if the object was found
    • containsAll

      public boolean containsAll(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 Collection
      Specified by:
      containsAll in interface List
      Parameters:
      c - The collection of objects to search for
      Returns:
      true if all the objects were found
    • get

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

      public int indexOf(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 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:
      isEmpty in interface Collection
      Specified by:
      isEmpty in interface List
      Returns:
      true if the record is empty
    • iterator

      public Iterator iterator()
      Gets an iterator over the records
      Specified by:
      iterator in interface Collection
      Specified by:
      iterator in interface Iterable
      Specified by:
      iterator in interface List
      Returns:
      An iterator over the records within this indexed record
    • lastIndexOf

      public int lastIndexOf(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 List
      Parameters:
      o - The object to search for
      Returns:
      The index of the object, or -1 if not found.
    • listIterator

      public 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 List
      Returns:
      A ListIterator over the records within this indexed record.
    • listIterator

      public 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 List
      Returns:
      A ListIterator over the records within this indexed record.
    • remove

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

      public 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 List
      Parameters:
      index - The index that should be removed
      Returns:
      The object instance that was removed.
    • removeAll

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

      public boolean retainAll(Collection c)
      This operation is not supported.
      Specified by:
      retainAll in interface Collection
      Specified by:
      retainAll in interface List
      Throws:
      UnsupportedOperationException
    • set

      public Object set(int index, 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 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

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

      public 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:
      subList in interface List
      Parameters:
      fromIndex - The index from which to start
      toIndex - The index at which to end
      Returns:
      A List spanning the two indexes.
    • toArray

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

      public Object[] toArray(Object[] a)
      Returns an array of byte[] objects. The input array must be of type byte[][].
      Specified by:
      toArray in interface Collection
      Specified by:
      toArray in interface List
      Parameters:
      a - An array of byte[] objects to be filled in.
      Returns:
      The array of objects in byte[] form.
    • clone

      public Object clone() throws CloneNotSupportedException
      Makes a copy of the list.
      Specified by:
      clone in interface jakarta.resource.cci.Record
      Returns:
      A copy of this indexed record.
      Throws:
      CloneNotSupportedException