Top Description Fields Constructors Methods
org.apache.http.impl.client

public Class RedirectLocations

extends AbstractList<Object>
Class Inheritance
Imports
java.net.URI, java.util.AbstractList, .ArrayList, .HashSet, .Iterator, .List, .Set

This class represents a collection of java.net.URIs used as redirect locations.
Since
4.0

Field Summary

Modifier and TypeField and Description
private final List<URI>
private final Set<URI>
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(final URI
element to be appended to this list
uri
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Adds a new URI to the collection.
public void
add(final int
index at which the specified element is to be inserted
index
,
final Object
URI 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 (must be a URI).
public boolean
contains(final URI uri)

Test if the URI is present in the collection.

public boolean

Returns:

true if this collection contains the specified element
contains
(final Object
element whose presence in this collection is to be tested
o
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Returns true if this collection contains the specified element.
public URI

Returns:

the URI at the specified position in this list
get
(final int
index of the location to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the URI at the specified position in this list.
public List<URI>

Returns:

list of all URIs
getAll
()

Returns all redirect URIs in the order they were added to the collection.

public boolean
remove(final URI uri)

Removes a URI from the collection.

public URI

Returns:

the URI previously at the specified position
remove
(final int
the index of the URI to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes the URI at the specified position in this list.
public Object

Returns:

the URI previously at the specified position
set
(final int
index of the element to replace
index
,
final Object
URI to be stored at the specified position
element
)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Replaces the URI at the specified position in this list with the specified element (must be a URI).
public int

Returns:

the number of elements in this list
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:
addAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

allback to summary
private final List<URI> all
uniqueback to summary
private final Set<URI> unique

Constructor Detail

RedirectLocationsback to summary
public RedirectLocations()

Method Detail

addback to summary
public void add(final URI uri)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Adds a new URI to the collection.

Parameters
uri:URI

Doc from java.util.AbstractList.add.

element to be appended to this list

Returns:void

Doc from java.util.AbstractList.add.

true (as specified by Collection#add)

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

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (must be a URI). Shifts the URI currently at that position (if any) and any subsequent URIs to the right (adds one to their indices).

Parameters
index:int

index at which the specified element is to be inserted

element:Object

URI to be inserted

Annotations
@Override
Exceptions
UnsupportedOperationException:
if the add operation is not supported by this list
ClassCastException:
if the element is not a URI
NullPointerException:
if the specified element is null and this list does not permit null elements
IndexOutOfBoundsException:
if the index is out of range ( index < 0 || index > size())
Since
4.3
containsback to summary
public boolean contains(final URI uri)

Test if the URI is present in the collection.

containsback to summary
public boolean contains(final Object o)

Overrides java.util.AbstractCollection.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)).

Parameters
o:Object

element whose presence in this collection is to be tested

Returns:boolean

true if this collection contains the specified element

Annotations
@Override
getback to summary
public URI get(final int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the URI at the specified position in this list.

Parameters
index:int

index of the location to return

Returns:URI

the URI at the specified position in this list

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if the index is out of range ( index < 0 || index >= size())
Since
4.3
getAllback to summary
public List<URI> getAll()

Returns all redirect URIs in the order they were added to the collection.

Returns:List<URI>

list of all URIs

Since
4.1
removeback to summary
public boolean remove(final URI uri)

Removes a URI from the collection.

removeback to summary
public URI remove(final int index)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes the URI at the specified position in this list. Shifts any subsequent URIs to the left (subtracts one from their indices). Returns the URI that was removed from the list.

Parameters
index:int

the index of the URI to be removed

Returns:URI

the URI previously at the specified position

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if the index is out of range ( index < 0 || index >= size())
Since
4.3
setback to summary
public Object set(final int index, final Object element)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Replaces the URI at the specified position in this list with the specified element (must be a URI).

Parameters
index:int

index of the element to replace

element:Object

URI to be stored at the specified position

Returns:Object

the URI previously at the specified position

Annotations
@Override
Exceptions
UnsupportedOperationException:
if the set operation is not supported by this list
ClassCastException:
if the element is not a URI
NullPointerException:
if the specified element is null and this list does not permit null elements
IndexOutOfBoundsException:
if the index is out of range ( index < 0 || index >= size())
Since
4.3
sizeback to summary
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. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override
Since
4.3