PHP Class Treffynnon\Navigator\Coordinate

Afficher le fichier Open project: treffynnon/navigator Class Usage Examples

Protected Properties

Свойство Type Description
$coordinate float The radian value of the supplied coordinate
$parser ParserInterface Parser object to use when converting a value to radians and back again

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

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() public méthode

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
Résultat string

get() public méthode

Get a coordinates radian value
public get ( ) : float
Résultat float

getParser() public méthode

Get the parser that is currently in use for this coordinate
public getParser ( ) : ParserInterface
Résultat ParserInterface

guessParser() public méthode

Guess the correct parser for a given coordinate
public guessParser ( float | string $coord ) : Treffynnon\Navigator\Coordinate\DecimalParser | DmsParser
$coord float | string
Résultat Treffynnon\Navigator\Coordinate\DecimalParser | Treffynnon\Navigator\Coordinate\DmsParser

set() public méthode

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

setParser() public méthode

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

Property Details

$coordinate protected_oe property

The radian value of the supplied coordinate
protected float $coordinate
Résultat float

$parser protected_oe property

Parser object to use when converting a value to radians and back again
protected ParserInterface $parser
Résultat ParserInterface