com.sap.netweaver.bc.uwl

Class ItemCollection

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.ItemCollection

public class ItemCollection
extends Object

The ItemCollection class represents Collection of objects. It contains quite a few methods from Collection. The pattern used here is "delegation". Quite a few methods are delegated to ArrayList.


Field Summary
static ItemCollection EMPTY_COLLECTION
           
 
Constructor Summary
ItemCollection()
          This constructor creates a default object of ItemCollection.
ItemCollection(List list)
          This constructor creates an object with an existing collection of Item objects.
 
Method Summary
 void add(Item item)
          Appends the specified element to the end of this list of Item objects.
 void addAll(Collection collection)
          Appends all of the elements in the specified collection to the end of this collection of Item objects, in the order that they are returned by the specified collection's iterator.
 void addAll(ItemCollection itemCollection)
          Appends all of the elements in the specified item collection to the end of this collection of Item objects, in the order that they are returned by the iterator of the internal list.
 void clear()
          This makes the list of Item objects null.
 Item find(long itemId)
          Searches for item with id passed.
 Item get(int index)
          This method behaves just like List.get(int) except for the fact that it casts the returning object to Item.
 List list()
           
 int size()
           
 void subSet(int from, int size)
          This method reduces the existing collection to a subset of the collection of Item objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_COLLECTION

public static final ItemCollection EMPTY_COLLECTION
Constructor Detail

ItemCollection

public ItemCollection(List list)
This constructor creates an object with an existing collection of Item objects.

Parameters:
list - the collection of Item objects.

ItemCollection

public ItemCollection()
This constructor creates a default object of ItemCollection.

Method Detail

add

public void add(Item item)
Appends the specified element to the end of this list of Item objects.

Parameters:
item - the object that needs to be added to the collection.
See Also:
List.add(Object)

get

public Item get(int index)
This method behaves just like List.get(int) except for the fact that it casts the returning object to Item.

Parameters:
index - the index of the item in the collection.
Returns:
Item the object stored at the given index.

size

public int size()
Returns:
int the size of this collection.
See Also:
List.size()

addAll

public void addAll(Collection collection)
Appends all of the elements in the specified collection to the end of this collection of Item objects, in the order that they are returned by the specified collection's iterator.

Parameters:
collection - the collection of Item objects.
See Also:
List.addAll(Collection)

addAll

public void addAll(ItemCollection itemCollection)
Appends all of the elements in the specified item collection to the end of this collection of Item objects, in the order that they are returned by the iterator of the internal list.

Parameters:
itemCollection - the collection of Item objects.
See Also:
List.addAll(Collection)

clear

public void clear()
This makes the list of Item objects null. Unlike List.clear(), this method sets the collection to be null.


list

public List list()
Returns:
List the list of Item objects.

subSet

public void subSet(int from,
                   int size)
This method reduces the existing collection to a subset of the collection of Item objects. It checks for the border conditions.

Parameters:
from - The starting Item
size - the number of Items. If from + size is greater than the actual size of the collection, it reduces the Items from from to the end of the list.

find

public Item find(long itemId)
Searches for item with id passed.

Parameters:
itemId -
Returns:
could be null


Copyright 2006 SAP AG Complete Copyright Notice