001: package org.odmg;
002:
003: /**
004:
005: * The ODMG Set collection interface.
006:
007: * A <code>DSet</code> object is an unordered collection that does not support
008:
009: * multiple elements with the same value. An implementation typically is very
010:
011: * efficient at determining whether the collection contains a particular value.
012:
013: * <p>
014:
015: * All of the operations defined by the JavaSoft <code>Set</code>
016:
017: * interface are supported by an ODMG implementation of <code>DSet</code>,
018:
019: * the exception <code>UnsupportedOperationException</code> is not thrown when a
020:
021: * call is made to any of the <code>Set</code> methods.
022:
023: * @author David Jordan (as Java Editor of the Object Data Management Group)
024:
025: * @version ODMG 3.0
026:
027: */
028:
029: // * @see java.lang.UnsupportedOperationException
030:
031: public interface DSet extends DCollection, java.util.Set
032:
033: {
034:
035: /**
036:
037: * Create a new <code>DSet</code> object that is the set union of this
038:
039: * <code>DSet</code> object and the set referenced by <code>otherSet</code>.
040:
041: * @param otherSet The other set to be used in the union operation.
042:
043: * @return A newly created <code>DSet</code> instance that contains the union of the two sets.
044:
045: */
046:
047: public DSet union(DSet otherSet);
048:
049: /**
050:
051: * Create a new <code>DSet</code> object that is the set intersection of this
052:
053: * <code>DSet</code> object and the set referenced by <code>otherSet</code>.
054:
055: * @param otherSet The other set to be used in the intersection operation.
056:
057: * @return A newly created <code>DSet</code> instance that contains the
058:
059: * intersection of the two sets.
060:
061: */
062:
063: public DSet intersection(DSet otherSet);
064:
065: /**
066:
067: * Create a new <code>DSet</code> object that contains the elements of this
068:
069: * collection minus the elements in <code>otherSet</code>.
070:
071: * @param otherSet A set containing elements that should not be in the result set.
072:
073: * @return A newly created <code>DSet</code> instance that contains the elements
074:
075: * of this set minus those elements in <code>otherSet</code>.
076:
077: */
078:
079: public DSet difference(DSet otherSet);
080:
081: /**
082:
083: * Determine whether this set is a subset of the set referenced by <code>otherSet</code>.
084:
085: * @param otherSet Another set.
086:
087: * @return True if this set is a subset of the set referenced by <code>otherSet</code>,
088:
089: * otherwise false.
090:
091: */
092:
093: public boolean subsetOf(DSet otherSet);
094:
095: /**
096:
097: * Determine whether this set is a proper subset of the set referenced by
098:
099: * <code>otherSet</code>.
100:
101: * @param otherSet Another set.
102:
103: * @return True if this set is a proper subset of the set referenced by
104:
105: * <code>otherSet</code>, otherwise false.
106:
107: */
108:
109: public boolean properSubsetOf(DSet otherSet);
110:
111: /**
112:
113: * Determine whether this set is a superset of the set referenced by <code>otherSet</code>.
114:
115: * @param otherSet Another set.
116:
117: * @return True if this set is a superset of the set referenced by <code>otherSet</code>,
118:
119: * otherwise false.
120:
121: */
122:
123: public boolean super setOf(DSet otherSet);
124:
125: /**
126:
127: * Determine whether this set is a proper superset of the set referenced by
128:
129: * <code>otherSet</code>.
130:
131: * @param otherSet Another set.
132:
133: * @return True if this set is a proper superset of the set referenced by
134:
135: * <code>otherSet</code>, otherwise false.
136:
137: */
138:
139: public boolean properSupersetOf(DSet otherSet);
140:
141: }
|