com.sapportals.wcm.repository
Interface IResourceList


public interface IResourceList

A typed list of IResource instances.

Copyright (c) SAP Portals Europe GmbH 2001

Version:
$Revision:$

Method Summary
 void add(int index, IResource resource)
          Inserts the specified resource at the specified position in this list.
 boolean add(IResource resource)
          Add the resource to the list.
 boolean addAll(IResourceList list)
          Add all the elements in the specified list to this list.
 boolean containsResource(IResource resource)
          Returns true if the specified resource is a member of the list.
 IResourceList difference(IResourceList list)
          Get the difference of this list to the given list.
Given a , b and c in this list; b , c and d in the given list, the result will contain only a .
 IResource get(int index)
          Returns the resource at the specified position.
 int indexOf(IResource resource)
          Returns the index in this list of the first occurrence of the specified resource, or -1 if the List does not contain this resource.
 IResourceList intersection(IResourceList list)
          Get the intersection of this list and the given list.
Given a , b and c in this list; b , c and d in the given list, the result will contain b and c .
 int lastIndexOf(IResource resource)
          Returns the index in this list of the last occurrence of the specified resource, or -1 if the List does not contain this resource.
 com.sapportals.wcm.repository.IResourceListIterator listIterator()
          Returns a resource-list-iterator of the elements in this list.
 com.sapportals.wcm.repository.IResourceListIterator listIterator(int index)
          Returns a list-iterator of the elements in this list, starting at the specified position in the list.
 IResource remove(int index)
          Removes the resource at the specified position in this list.
 boolean remove(IResource resource)
          Removes the first occurence of the specified resource from the list.
 IResource set(int index, IResource resource)
          Replaces the element at the specified position in this list with the specified resource.
 int size()
          Returns the size of the list.
 void sort(java.util.Comparator comp)
          Sort the elements in the list using the specified comparator
 IResourceList subList(int index1, int index2)
           
 IResourceList union(IResourceList list)
          Get the union of this list and the given list.
Given a , b and c in this list; b , c and d in the given list, the result will contain a , b , c and d .
 

Method Detail

add

public void add(int index,
                IResource resource)
Inserts the specified resource at the specified position in this list. Shifts the resources currently at that position (if any) and any subsequent resources to the right (adds one to their indices).
Parameters:
index - at which the specified resource is to be inserted.
resource - element to be inserted.

add

public boolean add(IResource resource)
Add the resource to the list.
Parameters:
resource - The resource to add to the list.
Returns:
TBD: Description of the outgoing return value

addAll

public boolean addAll(IResourceList list)
Add all the elements in the specified list to this list.
Parameters:
list - The list whose elements are to be added to this list.
Returns:
TBD: Description of the outgoing return value

containsResource

public boolean containsResource(IResource resource)
Returns true if the specified resource is a member of the list.
Parameters:
resource - TBD: Description of the incoming method parameter
Returns:
true if the specified resource is a member of the list.

difference

public IResourceList difference(IResourceList list)
Get the difference of this list to the given list.
Given a , b and c in this list; b , c and d in the given list, the result will contain only a .
Parameters:
list - the IResourceList to subtract from this list.
Returns:
the IResourceList with the difference list.

get

public IResource get(int index)
Returns the resource at the specified position.
Parameters:
index - of the resource to return.
Returns:
the resource at the specified position.

indexOf

public int indexOf(IResource resource)
Returns the index in this list of the first occurrence of the specified resource, or -1 if the List does not contain this resource.
Parameters:
resource - resource to search for.
Returns:
the index in this list of the first occurrence of the specified resource, or -1 if the List does not contain this resource.

intersection

public IResourceList intersection(IResourceList list)
Get the intersection of this list and the given list.
Given a , b and c in this list; b , c and d in the given list, the result will contain b and c .
Parameters:
list - the IResourceList to intersect with this list.
Returns:
the IResourceList with the intersection list.

lastIndexOf

public int lastIndexOf(IResource resource)
Returns the index in this list of the last occurrence of the specified resource, or -1 if the List does not contain this resource.
Parameters:
resource - resource to search for.
Returns:
the index in this list of the last occurrence of the specified resource, or -1 if the List does not contain this resource.

listIterator

public com.sapportals.wcm.repository.IResourceListIterator listIterator()
Returns a resource-list-iterator of the elements in this list.
Returns:
a resource-list-iterator of the elements in this list.

listIterator

public com.sapportals.wcm.repository.IResourceListIterator listIterator(int index)
Returns a list-iterator of the elements in this list, starting at the specified position in the list.
Parameters:
index - index of first element to be returned from the list-iterator (by a call to next).
Returns:
a resource-list-iterator of the elements in this list.

remove

public IResource remove(int index)
Removes the resource at the specified position in this list. Shifts any subsequent resources to the left (subtracts one from their indices).
Parameters:
index - the index of the resource to removed.
Returns:
the element previously at the specified position.

remove

public boolean remove(IResource resource)
Removes the first occurence of the specified resource from the list.
Parameters:
resource - TBD: Description of the incoming method parameter
Returns:
Returns true is this list contained the specified resource.

set

public IResource set(int index,
                     IResource resource)
Replaces the element at the specified position in this list with the specified resource.
Parameters:
index - index of resource to replace.
resource - resource to be stored at the specified position.
Returns:
the element previously at the specified position.

size

public int size()
Returns the size of the list.
Returns:
the size of the list.

sort

public void sort(java.util.Comparator comp)
Sort the elements in the list using the specified comparator
Parameters:
comp - The comparator used for sorting
See Also:
Comparator

subList

public IResourceList subList(int index1,
                             int index2)
Parameters:
index1 - TBD: Description of the incoming method parameter
index2 - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
See Also:
AbstractList.subList(int, int)

union

public IResourceList union(IResourceList list)
Get the union of this list and the given list.
Given a , b and c in this list; b , c and d in the given list, the result will contain a , b , c and d .
Parameters:
list - the IResourceList to union with this list.
Returns:
the IResourceList with the union list.