Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Interface dkCollection

All Known Implementing Classes:
DKSequentialCollection

public interface dkCollection

dkCollection is a base interface to a collection of any type of objects. A collection may have a name, the default is an empty string. It can be set to anything; for example, the name of the Digital Library index class where the members belong.

dkCollection is not queryable, and only supports dkIterator, the base class for all iterators.


Method Summary
 void addAllElements(dkCollection elements)
          Adds all elements in the collection, and invalidates all current iterators.
 void addElement(java.lang.Object element)
          Adds an element to the end of the collection, and invalidates all current iterators.
 int cardinality()
          Gets the number of elements in the collection.
 dkIterator createIterator()
          Creates a new iterator for this collection.
 java.lang.String getAssociatedAttrName()
          Gets the associated attribute name
 java.lang.String getName()
          Gets the name of the collection.
 dkDataObjectBase getOwner()
          Gets the owner data object for this collection.
 void insertElementAt(java.lang.Object element, dkIterator where)
          Adds a new element, after the element the iterator is currently pointing at.
 void removeAllElements()
          Removes all elements in the collection and invalidates all iterators.
 void removeElementAt(dkIterator where)
          Removes the element the iterator is currently pointing at.
 void replaceElementAt(java.lang.Object element, dkIterator where)
          Replaces the element the iterator is currently pointing at.
 java.lang.Object retrieveElementAt(dkIterator where)
          Gets the element that the iterator is pointing at.
 void setName(java.lang.String name)
          Sets the name of the collection.
 

Method Detail

cardinality

public int cardinality()
Gets the number of elements in the collection.
Returns:
the number of elements.

createIterator

public dkIterator createIterator()
Creates a new iterator for this collection.
Returns:
an iterator.

retrieveElementAt

public java.lang.Object retrieveElementAt(dkIterator where)
                                   throws DKUsageError
Gets the element that the iterator is pointing at.
Parameters:
where - the iterator for this collection pointing to the element.
Returns:
an element of the collection.

addElement

public void addElement(java.lang.Object element)
                throws DKUsageError
Adds an element to the end of the collection, and invalidates all current iterators.
Parameters:
element - element to be added

addAllElements

public void addAllElements(dkCollection elements)
                    throws DKUsageError
Adds all elements in the collection, and invalidates all current iterators.
Parameters:
elements - collection of elements to be added

insertElementAt

public void insertElementAt(java.lang.Object element,
                            dkIterator where)
                     throws DKUsageError
Adds a new element, after the element the iterator is currently pointing at. The iterator is advanced to the new element, invalidating all other iterators.
Parameters:
element - element to be added
where - location in collection

replaceElementAt

public void replaceElementAt(java.lang.Object element,
                             dkIterator where)
                      throws DKUsageError
Replaces the element the iterator is currently pointing at.
Parameters:
element - element to be added
where - location in collection

removeElementAt

public void removeElementAt(dkIterator where)
                     throws DKUsageError
Removes the element the iterator is currently pointing at. The iterator is advanced to the next element after this operation, invalidating all other iterators.
Parameters:
where - location in collection.

removeAllElements

public void removeAllElements()
                       throws DKUsageError
Removes all elements in the collection and invalidates all iterators.

setName

public void setName(java.lang.String name)
Sets the name of the collection.
Parameters:
name - collection name.

getName

public java.lang.String getName()
Gets the name of the collection.
Returns:
collection name.

getOwner

public dkDataObjectBase getOwner()
Gets the owner data object for this collection.
Returns:
owner data object.

getAssociatedAttrName

public java.lang.String getAssociatedAttrName()
Gets the associated attribute name
Returns:
associated attribute name.

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.