DOPs Framework 1.0 alpha

net.dops_framework.core
Interface RelationContext

All Superinterfaces:
DOAttribute

public interface RelationContext
extends DOAttribute

A relation context attribute, as enclosed in a digital object instance.
Each relationship developed between an instance and others abides to the respective relation context specifications defined in the prototypes of this instance.
A relation context instance attribute allows one to retrieve, and modify the members of the relationship being modelled, while at the same time forcing each member to conform to the respective relation context specification (be an instance of the prototypes defined therein).
Relation contexts hold the persistent identifiers of participating objects and respect the order in which members are added.

Version:
$Id: RelationContext.java,v 1.1 2007/03/05 03:28:15 saiko Exp $
Author:
Kostas Saidis (saikos [at] gmail [dot] com)
See Also:
RelationContextAttrSpec

Method Summary
 void addMember(String doId)
          Adds a new member identified by the supplied doId.
 void addMembers(String[] doIds)
          Adds new members using the identifiers contained in the supplied string array.
 Iterator allowedDops()
          Returns an iterator over the names of the allowed prototypes.
 String[] getAllMembers()
          Returns a string array containing all the members.
 int getMemberCount()
          Returns the member's count.
 String[] getMembers(int fromIndex, int toIndex)
          Returns a string array containing the members between fromIndex, inclusive and toIndex exclusive.
 boolean isAllowedDop(String dopId)
          Returns true if the supplied prototype is allowed.
 Iterator members()
          Returns an iterator over all members.
 String removeMember(int index)
          Removes the member at the given index.
 boolean removeMember(String doId)
          Removes the member with the given identifier.
 
Methods inherited from interface net.dops_framework.core.DOAttribute
getDescription, getFullyQualifiedId, getId, getLabel
 

Method Detail

allowedDops

Iterator allowedDops()
Returns an iterator over the names of the allowed prototypes.


isAllowedDop

boolean isAllowedDop(String dopId)
Returns true if the supplied prototype is allowed.


addMember

void addMember(String doId)
               throws IllegalArgumentException
Adds a new member identified by the supplied doId. If the given identifier is already present, no addition is made.

Throws:
IllegalArgumentException

addMembers

void addMembers(String[] doIds)
                throws IllegalArgumentException
Adds new members using the identifiers contained in the supplied string array. If any of these identifiers is already present, it is not added twice.

Throws:
IllegalArgumentException

removeMember

String removeMember(int index)
Removes the member at the given index.


removeMember

boolean removeMember(String doId)
Removes the member with the given identifier.


getMemberCount

int getMemberCount()
Returns the member's count.


getMembers

String[] getMembers(int fromIndex,
                    int toIndex)
                    throws IndexOutOfBoundsException,
                           IllegalArgumentException
Returns a string array containing the members between fromIndex, inclusive and toIndex exclusive.

Throws:
IndexOutOfBoundsException
IllegalArgumentException

getAllMembers

String[] getAllMembers()
Returns a string array containing all the members.


members

Iterator members()
Returns an iterator over all members.


Copyright (c) 2005-2007, Kostas Saidis.
Consult the license for terms and conditions of use.