/**
  * {@inheritdoc}
  */
 public function equals($other)
 {
     if (!$other instanceof self) {
         throw new \InvalidArgumentException('Invalid Rectangle Object');
     }
     if (!parent::equals($other)) {
         return false;
     }
     if (!$this->getDimension()->equals($other->getDimension())) {
         return false;
     }
     if (!$this->getStart()->equals($other->getStart())) {
         return false;
     }
     return true;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function equals($other)
 {
     if (!$other instanceof self) {
         throw new \InvalidArgumentException('Invalid Polygon Object');
     }
     if (!parent::equals($other)) {
         return false;
     }
     if (count($this->getCoordinates()) != count($other->getCoordinates())) {
         return false;
     }
     $count = count($this->getCoordinates());
     $cc = $this->getCoordinates();
     $oc = $other->getCoordinates();
     for ($x = 0; $x < $count; $x++) {
         if (!$cc[$x]->equals($oc[$x])) {
             return false;
         }
     }
     return true;
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function equals($other)
 {
     if (!$other instanceof self) {
         throw new \InvalidArgumentException('Invalid Arc Object');
     }
     if (!parent::equals($other)) {
         return false;
     }
     if (!$this->getDimension()->equals($other->getDimension())) {
         return false;
     }
     if (!$this->getCenter()->equals($other->getCenter())) {
         return false;
     }
     if ($this->getStartDegree() != $other->getStartDegree()) {
         return false;
     }
     if ($this->getEndDegree() != $other->getEndDegree()) {
         return false;
     }
     if ($this->isAnglesConnected() != $other->isAnglesConnected()) {
         return false;
     }
     if ($this->isAnglesConnectedToCenter() != $other->isAnglesConnectedToCenter()) {
         return false;
     }
     if ($this->isRounded() != $other->isRounded()) {
         return false;
     }
     return true;
 }