Changes the current direction value.

@param  string $direction
@throws \Beluga\GIS\GISError If the direction does not match the based latitude or longitude element.
330239
protected function initDirection( string $direction )
   {

      // Convert the direction to UPPER case
      $direction = \strtoupper( \trim( $direction ) );

      if ( \strlen( $direction ) != 1 )
      {
         // Bad Format
         throw new GISError(
            GISError::ERROR_TYPE_DIRECTION,
            \sprintf( "'%s' is not allowed.", $direction )
         );
      }

      if ( 'O' == $direction )
      {
         // Convert O to E
         $direction = 'E';
      }

      // Define the allowed 2 direction values
      $allowedDirections = $this->properties[ 'islatitude' ] ? array( 'N', 'S' ) : array( 'E', 'W' );

      if ( ! \in_array( $direction, $allowedDirections ) )
      {
         // Not allowed value
         throw new GISError(
            GISError::ERROR_TYPE_DIRECTION,
            \sprintf(
               "'%s' isnt allowed. Please use '%s'",
               $direction,
               \join( "' or '", $allowedDirections )
            )
         );
      }

      $this->properties[ 'direction' ] = $direction;

   }
970484
static public function isValid($direction, $throw = false)
    {
        $valid = in_array($direction, [
            static::NONE,
            static::ASC,
            static::DESC,
        ], true);

        if (!$valid && $throw) {
            throw new InvalidArgumentException(sprintf("The direction '%s' is not valid.", $direction));
        }

        return $valid;
    }
208006
private void changePage(final int direction) {
		int currentPage = pages.indexOf(cardManager.getVisible());
		currentPage = Math.min(2, Math.max(0, currentPage + direction));

		cardManager.makeVisible(pages.get(currentPage));

		prevButton.setDisabled(currentPage == 0);
		nextButton.setDisabled(currentPage == 2);
		finishButton.setDisabled(currentPage != 2);

		cancelButton.setUnsavedChanges(currentPage > 0);
	}
464703
public function setDirection($direction)
    {
        if ($direction === null) {
            $this->direction = $direction;
            return $this;
        }

        if (!is_string($direction)) {
            throw new InvalidArgumentException(
                'Direction must be a string.'
            );
        }

        $this->direction = strtolower($direction) === 'asc' ? 'ASC' : 'DESC';
        return $this;
    }
601633
public function setSortData($column, $direction = null)
    {
        if (null === $column) {
            return $this->clearSortData();
        }

        session()->put($this->getSessionKey(static::TYPE_SORT), [
            'column'    => $column,
            'direction' => $direction,
        ]);

        return $this;
    }
1225601
public static function setFetchSortingDirection($direction)
    {
        $direction = strtoupper($direction);

        if ($direction == 'RANDOM') {
            $direction = 'RAND';
        }

        self::$_fetchSortDirection = (in_array($direction, array('RAND', 'ASC', 'DESC')) ? $direction : null);
    }
967264
public function setOrderBy($sort, $direction = 'ASC')
    {
        $this->sort = $sort;
        $this->direction = $direction;
        return $this;
    }
1141099
function setGeo( $latitude, $longitude, $params=FALSE ) {
    $this->geo['value']['latitude']  = $latitude;
    $this->geo['value']['longitude'] = $longitude;
    $this->geo['params'] = $this->_setParams( $params );
  }
394423
public function setDirection($direction)
    {
        if ($direction !== self::DIRECTION_FORWARD && $direction !== self::DIRECTION_REVERSE && $direction !== self::DIRECTION_BOTH) {
            throw new InvalidArgumentException('Invalid direction given');
        }
        $this->direction = $direction;

        return $this;
    }
1212327
public function preFlightCheck($direction = null)
    {
        if (method_exists($this, MigrationInterface::CHANGE)) {
            if (method_exists($this, MigrationInterface::UP) ||
                method_exists($this, MigrationInterface::DOWN) ) {
                $this->output->writeln(sprintf(
                    '<comment>warning</comment> Migration contains both change() and/or up()/down() methods.  <options=bold>Ignoring up() and down()</>.'
                ));
            }
        }
    }
100593
public function setDirection($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyOrder_Direction::class);
        $this->direction = $var;

        return $this;
    }
320577
public function setOrder(string $order, string $direction): self
    {
        return $this->setParam('order', [$order => $direction]);
    }
706085
public function perform($direction = 'forward')
    {
        $direction = \PHPWarrior\Position::normalize_direction($direction);
        $this->verify_direction($direction);
        $receiver = $this->unit($direction);
        if ($receiver) {
            $this->unit->say(sprintf(
                __('attacks %1$s and hits %2$s'),
                __($direction),
                $receiver
            ));
            if ($direction === 'backward') {
                $power = ceil($this->unit->attack_power() / 2.0);
            } else {
                $power = $this->unit->attack_power();
            }
            $this->damage($receiver, $power);
        } else {
            $this->unit->say(sprintf(
                __("attacks %s and hits nothing"),
                __($direction)
            ));
        }
    }
1296856
public void setDirection (float x, float y, float z)
    {
        if (_dx != x || _dy != y || _dz != z) {
            AL10.alSource3f(_id, AL10.AL_DIRECTION, _dx = x, _dy = y, _dz = z);
        }
    }
503339
public function setDirection(int $pin, string $direction, bool $invert = false): bool
    {
        $this->export($pin);
        system("echo {$direction} > /sys/class/gpio/gpio{$pin}/direction");

        if ($invert) {
            $inverted = intval($invert);
            system("echo {$inverted} > /sys/class/gpio/gpio{$pin}/active_low");
        }

        if (file_exists("/sys/class/gpio/gpio{$pin}/direction") && (file_get_contents("/sys/class/gpio/gpio{$pin}/direction") == $direction)) {
            return true;
        }

        return false;

    }
212172
public function setLocation($location)
    {
        if (! is_int($location)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be an int value. Valued passed is of type ' . gettype($location));
        }
        
        $this->location = $location;
    }
680959
public function setDirectOnly($value)
    {
        if ($value !== null) {
            if($value == true) {
                $this->_params['directOnly'] = 'true';
            } else {
                $this->_params['directOnly'] = 'false';
            }
        } else {
            unset($this->_params['directOnly']);
        }
    }