@@ 223-231 (lines=9) @@ | ||
220 | * @param EnumSet $other |
|
221 | * @return bool |
|
222 | */ |
|
223 | public function isSubset(EnumSet $other) |
|
224 | { |
|
225 | if ($this->getEnumeration() !== $other->getEnumeration()) { |
|
226 | return false; |
|
227 | } |
|
228 | ||
229 | $thisBitset = $this->getBinaryBitsetLe(); |
|
230 | return ($thisBitset & $other->getBinaryBitsetLe()) === $thisBitset; |
|
231 | } |
|
232 | ||
233 | /** |
|
234 | * Check if this EnumSet is a superset of other |
|
@@ 238-246 (lines=9) @@ | ||
235 | * @param EnumSet $other |
|
236 | * @return bool |
|
237 | */ |
|
238 | public function isSuperset(EnumSet $other) |
|
239 | { |
|
240 | if ($this->getEnumeration() !== $other->getEnumeration()) { |
|
241 | return false; |
|
242 | } |
|
243 | ||
244 | $thisBitset = $this->getBinaryBitsetLe(); |
|
245 | return ($thisBitset | $other->getBinaryBitsetLe()) === $thisBitset; |
|
246 | } |
|
247 | ||
248 | /** |
|
249 | * Get ordinal numbers of the defined enumerators as array |