org.restlet.data

## Class ReferenceList

- java.lang.Object
- - org.restlet.util.WrapperList<Reference>
  - - org.restlet.data.ReferenceList

All Implemented Interfaces:
  java.lang.Iterable<Reference>, java.util.Collection<Reference>, java.util.List<Reference>

    public class ReferenceList
    extends WrapperList<Reference>

List of URI references.

Author:
  Jerome Louvel

### Constructor Summary

Constructors
Constructor and Description
`ReferenceList()` Constructor.
`ReferenceList(int initialCapacity)` Constructor.
`ReferenceList(java.util.List<Reference> delegate)` Constructor.
`ReferenceList(Representation uriList)` Constructor from a "text/uri-list" representation.

### Method Summary

Methods
`boolean` `add(java.lang.String uri)` Creates then adds a reference at the end of the list.
`Reference` `getIdentifier()` Returns the list identifier.
`Representation` `getTextRepresentation()` Returns a representation of the list in the "text/uri-list" format.
`Representation` `getWebRepresentation()` Returns a representation of the list in "text/html" format.
`void` `setIdentifier(Reference identifier)` Sets the list reference.
`void` `setIdentifier(java.lang.String identifier)` Sets the list reference.
`ReferenceList` `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 org.restlet.util.WrapperList

`add, add, addAll, addAll, clear, contains, containsAll, equals, get, getDelegate, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, toArray, toArray, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### ReferenceList

    public ReferenceList()

Constructor.

#### ReferenceList

    public ReferenceList(int initialCapacity)

Constructor.

Parameters:
  `initialCapacity` - The initial list capacity.

#### ReferenceList

    public ReferenceList(java.util.List<Reference> delegate)

Constructor.

Parameters:
  `delegate` - The delegate list.

#### ReferenceList

    public ReferenceList(Representation uriList)
                  throws java.io.IOException

Constructor from a "text/uri-list" representation.

Parameters:
  `uriList` - The "text/uri-list" representation to parse.
Throws:
  `java.io.IOException`

### Method Detail

#### add

    public boolean add(java.lang.String uri)

Creates then adds a reference at the end of the list.

Parameters:
  `uri` - The uri of the reference to add.
Returns:
  True (as per the general contract of the Collection.add method).

#### getIdentifier

    public Reference getIdentifier()

Returns the list identifier.

Returns:
  The list identifier.

#### getTextRepresentation

    public Representation getTextRepresentation()

Returns a representation of the list in the "text/uri-list" format.

Returns:
  A representation of the list in the "text/uri-list" format.

#### getWebRepresentation

    public Representation getWebRepresentation()

Returns a representation of the list in "text/html" format.

Returns:
  A representation of the list in "text/html" format.

#### setIdentifier

    public void setIdentifier(Reference identifier)

Sets the list reference.

Parameters:
  `identifier` - The list identifier.

#### setIdentifier

    public void setIdentifier(java.lang.String identifier)

Sets the list reference.

Parameters:
  `identifier` - The list identifier as a URI.

#### subList

    public ReferenceList subList(int fromIndex,
                        int toIndex)

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

Specified by:
  `subList` in interface `java.util.List<Reference>`
Overrides:
  `subList` in class `WrapperList<Reference>`
Parameters:
  `fromIndex` - The start position.
  `toIndex` - The end position (exclusive).
Returns:
  The sub-list.