PHP Класс Treffynnon\Navigator\Coordinate

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$coordinate float The radian value of the supplied coordinate
$parser ParserInterface Parser object to use when converting a value to radians and back again

Открытые методы

Метод Описание
__construct ( string | float $coord = null, Treffynnon\Navigator\Coordinate\ParserInterface $parser = null ) Setup a new coordinate
__toString ( ) : string Used when a coordinate value is used as a string. This uses the parser to output a human readable format converted from the radian value held in $this->coordinate
get ( ) : float Get a coordinates radian value
getParser ( ) : ParserInterface Get the parser that is currently in use for this coordinate
guessParser ( float | string $coord ) : Treffynnon\Navigator\Coordinate\DecimalParser | DmsParser Guess the correct parser for a given coordinate
set ( float $coord ) Sets the coordinate using the parser to a radian value
setParser ( Treffynnon\Navigator\Coordinate\ParserInterface $parser ) Set the parser that should be used to manage this coordinate

Описание методов

__construct() публичный Метод

Setup a new coordinate
public __construct ( string | float $coord = null, Treffynnon\Navigator\Coordinate\ParserInterface $parser = null )
$coord string | float
$parser Treffynnon\Navigator\Coordinate\ParserInterface

__toString() публичный Метод

Used when a coordinate value is used as a string. This uses the parser to output a human readable format converted from the radian value held in $this->coordinate
public __toString ( ) : string
Результат string

get() публичный Метод

Get a coordinates radian value
public get ( ) : float
Результат float

getParser() публичный Метод

Get the parser that is currently in use for this coordinate
public getParser ( ) : ParserInterface
Результат ParserInterface

guessParser() публичный Метод

Guess the correct parser for a given coordinate
public guessParser ( float | string $coord ) : Treffynnon\Navigator\Coordinate\DecimalParser | DmsParser
$coord float | string
Результат Treffynnon\Navigator\Coordinate\DecimalParser | Treffynnon\Navigator\Coordinate\DmsParser

set() публичный Метод

Sets the coordinate using the parser to a radian value
public set ( float $coord )
$coord float

setParser() публичный Метод

Set the parser that should be used to manage this coordinate
public setParser ( Treffynnon\Navigator\Coordinate\ParserInterface $parser )
$parser Treffynnon\Navigator\Coordinate\ParserInterface

Описание свойств

$coordinate защищенное свойство

The radian value of the supplied coordinate
protected float $coordinate
Результат float

$parser защищенное свойство

Parser object to use when converting a value to radians and back again
protected ParserInterface $parser
Результат ParserInterface