Top Description Fields Constructors Methods
com.thoughtworks.xstream.persistence

public Class XmlArrayList

extends AbstractList
Class Inheritance
Imports
java.util.AbstractList

A persistent list implementation backed on a XmlMap.
Author
Guilherme Silveira

Field Summary

Modifier and TypeField and Description
private final XmlMap
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
XmlArrayList(PersistenceStrategy persistenceStrategy)

Method Summary

Modifier and TypeMethod and Description
public void
add(int
index at which the specified element is to be inserted
index
,
Object
element to be inserted
element
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).
public Object
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
private void
rangeCheck(int index)

public Object
remove(int
the index of the element to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).
public Object
set(int
index of the element to replace
index
,
Object
element to be stored at the specified position
element
)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
Inherited from java.util.AbstractList:
addaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

mapback to summary
private final XmlMap map

Constructor Detail

XmlArrayListback to summary
public XmlArrayList(PersistenceStrategy persistenceStrategy)

Method Detail

addback to summary
public void add(int index, Object element)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Doc from java.util.AbstractList.add.

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).

Parameters
index:int

Doc from java.util.List.add.

index at which the specified element is to be inserted

element:Object

Doc from java.util.List.add.

element to be inserted

getback to summary
public Object get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:Object

Doc from java.util.List.get.

the element at the specified position in this list

rangeCheckback to summary
private void rangeCheck(int index)
removeback to summary
public Object remove(int index)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.AbstractList.remove.

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.

Parameters
index:int

Doc from java.util.List.remove.

the index of the element to be removed

Returns:Object

Doc from java.util.List.remove.

the element previously at the specified position

setback to summary
public Object set(int index, Object element)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Doc from java.util.AbstractList.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

Parameters
index:int

Doc from java.util.List.set.

index of the element to replace

element:Object

Doc from java.util.List.set.

element to be stored at the specified position

Returns:Object

Doc from java.util.List.set.

the element previously at the specified position

sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list