1 9 package org.ozoneDB.odmg; 10 11 import org.odmg.*; 12 import java.util.*; 14 15 16 20 public class OzoneODMGDSet extends HashSet implements DSet { 21 22 23 public OzoneODMGDSet() { 24 super(); 25 } 26 27 28 public OzoneODMGDSet( Collection _collection ) { 29 super( _collection ); 30 } 31 32 33 39 public DSet union( DSet otherSet ) { 40 DSet result = new OzoneODMGDSet( this ); 41 result.addAll( otherSet ); 42 return result; 43 } 44 45 46 53 public DSet intersection( DSet otherSet ) { 54 DSet result = new OzoneODMGDSet( this ); 55 result.retainAll( otherSet ); 56 return result; 57 } 58 59 60 67 public DSet difference( DSet otherSet ) { 68 DSet result = new OzoneODMGDSet( this ); 69 result.removeAll( otherSet ); 70 return result; 71 } 72 73 74 80 public boolean subsetOf( DSet otherSet ) { 81 return otherSet.containsAll( this ); 82 } 83 84 85 92 public boolean properSubsetOf( DSet otherSet ) { 93 return this.size() == otherSet.size() && subsetOf( otherSet ); 95 } 96 97 98 104 public boolean supersetOf( DSet otherSet ) { 105 return this.containsAll( otherSet ); 106 } 107 108 109 116 public boolean properSupersetOf( DSet otherSet ) { 117 return this.size() == otherSet.size() && supersetOf( otherSet ); 119 } 120 121 122 125 public Object selectElement( String predicate ) throws QueryInvalidException { 126 throw new NotImplementedException( "OQL not supported" ); 127 } 128 129 130 133 public java.util.Iterator select( String predicate ) throws QueryInvalidException { 134 throw new NotImplementedException( "OQL not supported" ); 135 } 136 137 138 141 public DCollection query( String predicate ) throws QueryInvalidException { 142 throw new NotImplementedException( "OQL not supported" ); 143 } 144 145 146 149 public boolean existsElement( String predicate ) throws QueryInvalidException { 150 throw new NotImplementedException( "OQL not supported" ); 151 } 152 153 } 154 | Popular Tags |