Exemplo n.º 1
0
 /**
  * This method returns whether the iterator is still valid.
  *
  * @access public
  * @final
  * @return bool                                             whether there are more objects
  */
 public final function valid() : bool
 {
     return $this->i->unbox() < $this->xs->__length();
 }
Exemplo n.º 2
0
 /**
  * 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();
 }