/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param IObject\Type $x the left operand * @param Core\Type $y the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(IObject\Type $x, Core\Type $y) : IBool\Type { // === if ($y !== null) { if ($x->__typeOf() === $y->__typeOf()) { return IBool\Type::box($x->unbox() === $y->unbox()); } } return IBool\Type::false(); }
/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param IUnit\Type $x the left operand * @param Core\Type $y the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(IUnit\Type $x, Core\Type $y) : IBool\Type { // === $type = $x === null ? '\\Saber\\Data\\IUnit\\Type' : $x->__typeOf(); return IBool\Type::box($y === null || $type === $y->__typeOf()); }
/** * This method evaluates whether the specified object is identical to the current object. * * @access public * @static * @param IOption\Type $xs the left operand * @param Core\Type $ys the object to be evaluated * @return IBool\Type whether the specified object is identical * to the current object */ public static function id(IOption\Type $xs, Core\Type $ys) : IBool\Type { if ($ys !== null) { if ($xs->__typeOf() === $ys->__typeOf()) { if ($ys instanceof IOption\Some\Type) { $x = $xs->item(); $y = $ys->item(); if ($x === null) { return IBool\Type::box($y === null); } else { if ($x instanceof Core\Equality\Type) { return $x->id($y); } } return IBool\Type::box(spl_object_hash($x) === spl_object_hash($y)); } else { if ($ys instanceof IOption\None\Type) { return IBool\Type::true(); } } } } return IBool\Type::false(); }
/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param Throwable\Runtime\Exception $x the left operand * @param Core\Type $y the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(Throwable\Runtime\Exception $x, Core\Type $y) { // === if ($y !== null) { if ($x->__typeOf() === $y->__typeOf()) { return IBool\Type::box($x->__hashCode() === $y->__hashCode()); } } return IBool\Type::false(); }
/** * This method evaluates whether the specified object is identical to the current object. * * @access public * @static * @param IString\Type $xs the left operand * @param Core\Type $ys the object to be evaluated * @return IBool\Type whether the specified object is identical * to the current object */ public static function id(IString\Type $xs, Core\Type $ys) : IBool\Type { if ($ys !== null) { if ($xs->__typeOf() === $ys->__typeOf()) { return IBool\Type::box($xs->unbox() === $ys->unbox()); } } return IBool\Type::false(); }
/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param IInt32\Type $x the left operand * @param Core\Type $y the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(IInt32\Type $x, Core\Type $y) : IBool\Type { // === if ($x->__typeOf() === $y->__typeOf()) { return IBool\Type::box($x->unbox() === $y->unbox()); } return IBool\Type::false(); }
/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param IHashMap\Type $xs the left operand * @param Core\Type $ys the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(IHashMap\Type $xs, Core\Type $ys) : IBool\Type { // === if ($ys !== null && $xs->__typeOf() === $ys->__typeOf()) { if (IInt32\Module::eq($xs->size(), $ys->size())) { return IBool\Type::box((string) serialize($xs) == (string) serialize($ys)); } } return IBool\Type::false(); }
/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param ITuple\Type $xs the left operand * @param Core\Type $ys the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(ITuple\Type $xs, Core\Type $ys) : IBool\Type { // === if ($xs->__typeOf() === $ys->__typeOf()) { return IBool\Type::box(ITuple\Module::compare($xs, $ys)->unbox() == 0); } return IBool\Type::false(); }
/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param IRatio\Type $x the left operand * @param Core\Type $y the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(IRatio\Type $x, Core\Type $y) : IBool\Type { // === if ($x->__typeOf() === $y->__typeOf()) { return IBool\Module::and_(IInt32\Module::id($x->numerator(), $y->numerator()), IInt32\Module::id($x->denominator(), $y->denomintor())); } return IBool\Type::false(); }
/** * This method returns the hash set with the item removed. * * @access public * @final * @param Core\Type $item the item to be removed * @return IHashSet\Type the hash set */ public final function removeItem(Core\Type $item) : IHashSet\Type { $hashCode = $item->__hashCode(); if (array_key_exists($hashCode, $this->value)) { $bucket = $this->value[$hashCode]; $type = $item->__typeOf(); $buffer = array(); foreach ($bucket as $entry) { if ($type != $entry->__typeOf()) { $buffer[] = $entry; } } if (empty($buffer)) { unset($this->value[$hashCode]); } else { $this->value[$hashCode] = $buffer; } } return $this; }
/** * This method evaluates whether the left operand is identical to the right operand. * * @access public * @static * @param IArrayList\Type $xs the left operand * @param Core\Type $ys the right operand * @return IBool\Type whether the left operand is identical * to the right operand */ public static function id(IArrayList\Type $xs, Core\Type $ys) : IBool\Type { // === if ($ys !== null) { if ($xs->__typeOf() === $ys->__typeOf()) { $x_length = $xs->__length(); $y_length = $ys->__length(); for ($i = 0; $i < $x_length && $i < $y_length; $i++) { $p = IInt32\Type::box($i); $r = $xs->item($p)->id($ys->item($p)); if (!$r->unbox()) { return $r; } } return IBool\Type::box($x_length == $y_length); } } return IBool\Type::false(); }