PHP 클래스 Treffynnon\Navigator\Coordinate

파일 보기 프로젝트 열기: treffynnon/navigator 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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