Index

DKLinkCollection

Purpose:

DKLinkCollection is a subclass of sequential collection. The main purpose of this class is for holding a group of DKLink objects each of which represent a link relationship between two item DDOs. The instance of this class containing child DDOs is used as the data-item value of the parent DDO.

Since: Version 8

Class summary:

class DKEXPORT DKLinkCollection: public DKSequentialCollection
{
   public:
     DKLinkCollection();
     virtual ~DKLinkCollection();
     virtual void addElement(const DKAny& element); 
     virtual void insertElementAt(const DKAny& element, dkIterator& where); 
     virtual void replaceElementAt(const DKAny& element, dkIterator& where); 
     virtual void removeElementAt(dkIterator& where); 
     virtual void removeAllElements(); 
     
     virtual void addMember(DKLink* link);
     virtual void removeMember(DKLink* link);
     virtual void removeAllMembers();
     virtual dkIterator* createOutboundIterator() const;
     virtual dkIterator* createInboundIterator() const;
};

Members:

Constructors and destructor
DKLinkCollection();
virtual ~DKLinkCollection();

Member functions

addElement
Definition

insertElementAt
Definition

replaceElementAt
Definition

removeElementAt
Definition

removeAllElements
Definition

addMember
Add a link to this collection and make the change persistent. "Member" methods should be used when a small number of links are added or removed infrequently, one at a time. Alternatively, "Element" methods allow multiple updates to be grouped together in a persistent update.

Parameters: link - a link object

Throws: DKException - If problem is encountered

virtual void addMember(DKLink* link);

removeMember
Removes a link from this collection and makes the change persistent. "Member" methods should be used when a small number of links are added or removed infrequently, one at a time. Alternatively, "Element" methods allow multiple updates to be grouped together in a persistent update.

Parameters: link - a link object

Throws: DKException - If problem is encountered

virtual void removeMember(DKLink* link);

removeAllMembers
Removes all links from this collection and make the change persistent. No further update for the persistent store is required.

Throws: DKException - If problem is encountered

virtual void removeAllMembers();

createOutboundIterator
The iterator created will return only links that are considered to be outbound in relation to the data object that owns this collection. The concepts of inbound and outbound are relative to the data object being referenced. A link simply relates a source and a target and is not considered inbound or outbound. From the view point of the data objects at either end of the link, the link may be inbound or outbound. If the owner of this collection is the source of the link, the link is considered to be outbound. If the owner of this collection is the target of the link, the link is considered to be inbound.

Returns: an iterator which must be deleted by the user

virtual dkIterator* createOutboundIterator() const;

createInboundIterator
The iterator created will return only links that are considered to be inbound in relation to the data object that owns this collection. The concepts of inbound and outbound are relative to the data object being referenced. A link simply relates a source and a target and is not considered inbound or outbound. From the view point of the data objects at either end of the link, the link may be inbound or outbound. If the owner of this collection is the source of the link, the link is considered to be outbound. If the owner of this collection is the target of the link, the link is considered to be inbound.

Returns: an iterator which must be deleted by the user

virtual dkIterator* createInboundIterator() const;

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