nesstar.rdf
Class RDFList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by nesstar.rdf.RDFList
All Implemented Interfaces:
Iterable, Collection, List

public class RDFList
extends AbstractList

A list of RDF objects. It provides mutable List interface on top of a bag.

Created:
26 April 2002
Bug:
10 July 2002 the toString() method causes a lookup for each object from the list, resulting in a quick and uncontrolled series of remote bean lookups, each time going through NEOOM2EJBServlet/BrigdeBean. This causes Tomcat to run out of available Threads before it has a chance to return the objects.

Method Summary
 void add(int index, Object element)
          Inserts the specified element at the specified position in this list Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
 void clear()
          Removes all the elements in the bag.
 Object get(int index)
          Method
 RDFBag getBag()
           
 URL getID()
           
static RDFList getList(RDFBag bag)
          Gets the list attribute of the RDFList class
static RDFList getList(RDFRef ref)
           
 void reload()
          Reload the underlying Bag
 Object remove(int index)
          Removes the element at the specified position in this list.
 Object set(int index, Object element)
          Replaces the element at the specified position in this list with the specified element
 int size()
          Method
 
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Method Detail

getBag

public RDFBag getBag()

getID

public URL getID()

set

public Object set(int index,
                  Object element)
Replaces the element at the specified position in this list with the specified element

Specified by:
set in interface List
Overrides:
set in class AbstractList
Parameters:
index - - index of element to replace.
element - - element to be stored at the specified position.
Returns:
the element previously at the specified position.
Throws:
ClassCastException - - if the specified element does not inherits from RDFObject
IndexOutOfBoundsException - - if the specified index is out of range (index < 0 || index >= size()).

getList

public static RDFList getList(RDFRef ref)
                       throws Exception
Parameters:
ref - the reference to a bag that represents a 1 to N relationship
Returns:
the RDFList that represents the relationship.
Throws:
Exception

getList

public static RDFList getList(RDFBag bag)
                       throws Exception
Gets the list attribute of the RDFList class

Parameters:
bag -
Returns:
The list value
Throws:
Exception

get

public Object get(int index)
Method

Specified by:
get in interface List
Specified by:
get in class AbstractList
Parameters:
index -
Returns:

reload

public void reload()
            throws Exception
Reload the underlying Bag

Throws:
Exception

size

public int size()
Method

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:

add

public void add(int index,
                Object element)
Inserts the specified element at the specified position in this list Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Specified by:
add in interface List
Overrides:
add in class AbstractList
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
ClassCastException - - if the specified element does not inherits from RDFObject
IndexOutOfBoundsException - - if the specified index is out of range (index < 0 || index >= size()).

remove

public Object remove(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).

Specified by:
remove in interface List
Overrides:
remove in class AbstractList
Parameters:
index - - the index of the element to remove.
Returns:
the element that was removed from the list.

clear

public void clear()
Removes all the elements in the bag.

Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class AbstractList

Nesstar SDK

Copyright©2003 NSD - All Rights Reserved