Location class¶
Diagram¶
classDiagram
class Location {
-Latitude latitude
-Longitude longitude
+latitude() Latitude
+longitude() Longitude
}
class Latitude
class Longitude
Location --* Latitude : contains
Location --* Longitude : contains
Summary¶
Language | Type | Symbol |
---|---|---|
C | struct | Location |
C++ | struct | dogma::Location |
Dart | class | Location |
Go | struct | dogma.Location |
Java | interface | dogma.Location |
JS | class | dogma.Location |
Protobuf | message | dogma.Location |
Python | class | dogma.Location |
Ruby | class | Dogma::Location |
Rust | struct | dogma::Location |
Zig | struct | dogma.Location |
Description¶
Import¶
#include <dogma.h> // for Location
#include <dogma.hpp> // for Location
using dogma::Location;
import 'package:dogma/dogma.dart' show Location;
import "github.com/dogmatists/dogma.go/dogma"
import dogma.Location;
import {Location} from "./dogma.js";
from dogma import Location
require 'dogma'
include Dogma::Location
extern crate dogma;
use dogma::Location;
const Location = @import("dogma").Location;
Constants¶
Constructor¶
Location(27.9881, 86.9250)
Location{27.9881, 86.9250}
Location(27.9881, 86.9250)
NewLocation(27.9881, 86.9250)
Location.of(27.9881, 86.9250)
new Location(27.9881, 86.9250)
Location(27.9881, 86.9250)
Location.new(27.9881, 86.9250)
Location::new(27.9881, 86.9250)
Location.init(27.9881, 86.9250)
Properties¶
latitude¶
longitude¶
Methods¶
Schema¶
struct Location {
latitude: Latitude;
longitude: Longitude;
}
Joi.object().keys({
latitude: Joi.number().min(-90).max(90).required(),
longitude: Joi.number().min(-180).max(180).required(),
})
{
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
}
},
"required": ["latitude", "longitude"]
}
# TODO
message Location {
Latitude latitude = 1;
Longitude longitude = 2;
}
latitude DOUBLE PRECISION, -- in degrees from -90° to 90°
longitude DOUBLE PRECISION, -- in degrees from -180° to 180°
<xs:complexType name="Location">
<xs:attribute name="latitude" type="Latitude" use="required"/>
<xs:attribute name="longitude" type="Longitude" use="required"/>
</xs:complexType>
Serialization¶
{"latitude": 27.9881, "longitude": 86.9250} // Mt. Everest
// TODO
<location latitude="27.9881" longitude="86.9250"/> <!-- Mt. Everest -->