Oracle® Coherence Java API Reference
v3.5.3

E15583-01

com.tangosol.util
Class ConverterCollections.ConverterList

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ConverterCollections.ConverterCollection
          extended by com.tangosol.util.ConverterCollections.ConverterList
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.List
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterList
extends ConverterCollections.ConverterCollection
implements java.util.List, java.io.Serializable

A Converter List views an underlying List through a Converter.


Field Summary
 
Fields inherited from class com.tangosol.util.ConverterCollections.ConverterCollection
m_col, m_convDown, m_convUp
 
Constructor Summary
ConverterCollections.ConverterList(java.util.List list, Converter convUp, Converter convDown)
          Constructor.
 
Method Summary
 void add(int index, java.lang.Object element)
          Inserts the specified element at the specified position in this list (optional operation).
 boolean addAll(int index, java.util.Collection col)
          Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
 java.lang.Object get(int index)
          Returns the element at the specified position in this list.
 java.util.List getList()
          Return the underlying List.
 int indexOf(java.lang.Object o)
          Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
protected  java.util.List instantiateList(java.util.List list, Converter convUp, Converter convDown)
          Create a Converter List.
protected  java.util.ListIterator instantiateListIterator(java.util.ListIterator iter, Converter convUp, Converter convDown)
          Create a Converter ListIterator.
 int lastIndexOf(java.lang.Object o)
          Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
 java.util.ListIterator listIterator()
          Returns a list iterator of the elements in this list (in proper sequence).
 java.util.ListIterator listIterator(int index)
          Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
 java.lang.Object remove(int index)
          Removes the element at the specified position in this list (optional operation).
 java.lang.Object set(int index, java.lang.Object element)
          Replaces the element at the specified position in this list with the specified element (optional operation).
 java.util.List subList(int fromIndex, int toIndex)
          Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
 
Methods inherited from class com.tangosol.util.ConverterCollections.ConverterCollection
add, addAll, clear, contains, containsAll, equals, getCollection, getConverterDown, getConverterUp, instantiateCollection, instantiateIterator, invalidate, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

ConverterCollections.ConverterList

public ConverterCollections.ConverterList(java.util.List list,
                                          Converter convUp,
                                          Converter convDown)
Constructor.

Parameters:
list - the underlying List
convUp - the Converter from the underlying List
convDown - the Converter to the underlying List
Method Detail

get

public java.lang.Object get(int index)
Returns the element at the specified position in this list.

Specified by:
get in interface java.util.List
Parameters:
index - index of element to return
Returns:
the element at the specified position in this list

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Replaces the element at the specified position in this list with the specified element (optional operation).

Specified by:
set in interface java.util.List
Parameters:
index - index of element to replace.
element - element to be stored at the specified position.
Returns:
the element previously at the specified position.

add

public void add(int index,
                java.lang.Object element)
Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Specified by:
add in interface java.util.List
Parameters:
index - index at which the specified element is to be inserted
element - element to be inserted

addAll

public boolean addAll(int index,
                      java.util.Collection col)
Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

Specified by:
addAll in interface java.util.List
Parameters:
index - index at which to insert first element from the specified collection
col - elements to be inserted into this list
Returns:
true if this list changed as a result of the call

remove

public java.lang.Object remove(int index)
Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Specified by:
remove in interface java.util.List
Parameters:
index - the index of the element to removed
Returns:
the element previously at the specified position

indexOf

public int indexOf(java.lang.Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Specified by:
indexOf in interface java.util.List
Parameters:
o - element to search for
Returns:
the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Specified by:
lastIndexOf in interface java.util.List
Parameters:
o - element to search for
Returns:
the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.

listIterator

public java.util.ListIterator listIterator()
Returns a list iterator of the elements in this list (in proper sequence).

Specified by:
listIterator in interface java.util.List
Returns:
a list iterator of the elements in this list (in proper sequence)

listIterator

public java.util.ListIterator listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list. The specified index indicates the first element that would be returned by an initial call to the next method. An initial call to the previous method would return the element with the specified index minus one.

Specified by:
listIterator in interface java.util.List
Parameters:
index - index of first element to be returned from the list iterator (by a call to the next method)
Returns:
a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. Obeys the general contract of List.subList.

Specified by:
subList in interface java.util.List
Parameters:
fromIndex - low endpoint (inclusive) of the subList
toIndex - high endpoint (exclusive) of the subList
Returns:
a view of the specified range within this list

instantiateList

protected java.util.List instantiateList(java.util.List list,
                                         Converter convUp,
                                         Converter convDown)
Create a Converter List.

Parameters:
list - the underlying List
convUp - the Converter to view the underlying List through
convDown - the Converter to pass items down to the underlying List through
Returns:
a Converter List

instantiateListIterator

protected java.util.ListIterator instantiateListIterator(java.util.ListIterator iter,
                                                         Converter convUp,
                                                         Converter convDown)
Create a Converter ListIterator.

Parameters:
iter - the underlying ListIterator
convUp - the Converter to view the underlying ListIterator through
convDown - the Converter to pass items down to the underlying ListIterator through
Returns:
a Converter ListIterator

getList

public java.util.List getList()
Return the underlying List.

Returns:
the underlying List

Oracle® Coherence Java API Reference
v3.5.3

E15583-01

Copyright © 2000, 2010, Oracle. All rights reserved.