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