Package com.tietoenator.trip.jxp
Class TdbMessageProvidingList<E>
- java.lang.Object
-
- com.tietoenator.trip.jxp.session.TdbSessionObject
-
- com.tietoenator.trip.jxp.TdbMessageProvider
-
- com.tietoenator.trip.jxp.TdbMessageProvidingList<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
- Direct Known Subclasses:
TdbControlObjectList
public class TdbMessageProvidingList<E> extends TdbMessageProvider implements java.util.List<E>
-
-
Constructor Summary
Constructors Constructor Description TdbMessageProvidingList(TdbSession session, TdbInterfaceType type)
Constructor, should only be used by a derived classTdbMessageProvidingList(TdbMessageProvidingList<E> r)
Copy constructor, used to derive a list from an existing list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, E o)
Add a new element to the list at the provided positionboolean
add(E o)
Add a new element to the listboolean
addAll(int index, java.util.Collection<? extends E> c)
Insert the contents of the provided collection at the provided offset into the current listboolean
addAll(java.util.Collection<? extends E> c)
Add the contents of the provided collection to the current listvoid
clear()
Remove all content from the current listboolean
contains(java.lang.Object o)
Check if the list contains a specific elementboolean
containsAll(java.util.Collection<?> c)
Check if all elements in the provided collection are contained within the current listE
get(int index)
Retrieve the strongly-typed element at the provided offsetint
indexOf(java.lang.Object o)
Retrieve the offset within the list at which the provided object exists, if anyboolean
isEmpty()
Test the list for emptinessjava.util.Iterator<E>
iterator()
Retrieve an iterator over the list, suitable for use in the for-each coding patternint
lastIndexOf(java.lang.Object o)
Retrieve the offset of the most highly-ordered element that matches the provided objectjava.util.ListIterator<E>
listIterator()
Retrieve an iterator over the listjava.util.ListIterator<E>
listIterator(int index)
Retrieve an iterator over the listE
remove(int index)
Remove and return the item at the provided offsetboolean
remove(java.lang.Object o)
Remove the provided object from the list, if foundboolean
removeAll(java.util.Collection<?> c)
Remove all items from the list that match objects in the provided collectionboolean
retainAll(java.util.Collection<?> c)
Removes all items from the list that are not contained within the provided collectionE
set(int index, E element)
Modify the list to set the item at the provided offset to the provided contentint
size()
Retrieve the number of objects contained within the listjava.util.List<E>
subList(int fromIndex, int toIndex)
Retrieve a new list object that contains elements within a range of the current listjava.lang.Object[]
toArray()
Retrieve an array containing elements from the list, in proper sequence<T> T[]
toArray(T[] a)
Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.-
Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
-
Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject
cancel, getSession, isCancelable, setCancelable
-
-
-
-
Constructor Detail
-
TdbMessageProvidingList
public TdbMessageProvidingList(TdbSession session, TdbInterfaceType type) throws TdbException
Constructor, should only be used by a derived class- Parameters:
session
- Active sessiontype
- Type of connection for which this list is valid- Throws:
TdbException
-
TdbMessageProvidingList
public TdbMessageProvidingList(TdbMessageProvidingList<E> r) throws TdbException
Copy constructor, used to derive a list from an existing list- Parameters:
r
- Existing list from which to copy- Throws:
TdbException
-
-
Method Detail
-
add
public boolean add(E o)
Add a new element to the list
-
add
public void add(int index, E o)
Add a new element to the list at the provided position- Specified by:
add
in interfacejava.util.List<E>
- Parameters:
index
- Offset at which to insert new elemento
- New element to insert
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
Add the contents of the provided collection to the current list
-
addAll
public boolean addAll(int index, java.util.Collection<? extends E> c)
Insert the contents of the provided collection at the provided offset into the current list- Specified by:
addAll
in interfacejava.util.List<E>
- Parameters:
index
- Offset at which to start insertingc
- Collection to copy- Returns:
- true as required by the Collections framework contract
-
clear
public void clear()
Remove all content from the current list
-
contains
public boolean contains(java.lang.Object o)
Check if the list contains a specific element
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
Check if all elements in the provided collection are contained within the current list
-
get
public E get(int index)
Retrieve the strongly-typed element at the provided offset- Specified by:
get
in interfacejava.util.List<E>
- Parameters:
index
- Offset from which to retrieve the element- Returns:
- The element at the provided offset
-
indexOf
public int indexOf(java.lang.Object o)
Retrieve the offset within the list at which the provided object exists, if any- Specified by:
indexOf
in interfacejava.util.List<E>
- Parameters:
o
- The object for which to retrieve the offset- Returns:
- The index of the provided element
-
isEmpty
public boolean isEmpty()
Test the list for emptiness
-
iterator
public java.util.Iterator<E> iterator()
Retrieve an iterator over the list, suitable for use in the for-each coding pattern
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
Retrieve the offset of the most highly-ordered element that matches the provided object- Specified by:
lastIndexOf
in interfacejava.util.List<E>
- Parameters:
o
- Object for which to search- Returns:
- right-most offset
-
listIterator
public java.util.ListIterator<E> listIterator()
Retrieve an iterator over the list- Specified by:
listIterator
in interfacejava.util.List<E>
- Returns:
- The list iterator
-
listIterator
public java.util.ListIterator<E> listIterator(int index)
Retrieve an iterator over the list- Specified by:
listIterator
in interfacejava.util.List<E>
- Returns:
- The list iterator
-
remove
public boolean remove(java.lang.Object o)
Remove the provided object from the list, if found
-
remove
public E remove(int index)
Remove and return the item at the provided offset- Specified by:
remove
in interfacejava.util.List<E>
- Parameters:
index
- The index from which to remove the item- Returns:
- The item that was removed
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
Remove all items from the list that match objects in the provided collection
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
Removes all items from the list that are not contained within the provided collection
-
set
public E set(int index, E element)
Modify the list to set the item at the provided offset to the provided content- Specified by:
set
in interfacejava.util.List<E>
- Parameters:
index
- The offset of the item to modifyelement
- The new content for the provided offset- Returns:
- The old content at the provided offset
-
size
public int size()
Retrieve the number of objects contained within the list
-
subList
public java.util.List<E> subList(int fromIndex, int toIndex)
Retrieve a new list object that contains elements within a range of the current list- Specified by:
subList
in interfacejava.util.List<E>
- Parameters:
fromIndex
- the offset at which the operation is to begintoIndex
- the offset at which the operation is to stop- Returns:
- a new list containing items from the old list, between the range of offsets provided
-
toArray
public java.lang.Object[] toArray()
Retrieve an array containing elements from the list, in proper sequence
-
toArray
public <T> T[] toArray(T[] a)
Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.- Specified by:
toArray
in interfacejava.util.Collection<E>
- Specified by:
toArray
in interfacejava.util.List<E>
- Parameters:
a
- the array into which elements of this list are to be stored; if this array is not big enough, another array will be allocated of the same runtime type.- Returns:
- the array into which elements were stored; might be different from the provided array if the provided array was too small, but the runtime types will match.
-
-