/src/com/google/maps/extras/xmlparsers/kml/Data.as
ActionScript | 61 lines | 31 code | 6 blank | 24 comment | 0 complexity | f39c04d44cf4c18b2101ed491966a039 MD5 | raw file
1/* 2* Copyright 2008 Google Inc. 3* Licensed under the Apache License, Version 2.0: 4* http://www.apache.org/licenses/LICENSE-2.0 5*/ 6package com.google.maps.extras.xmlparsers.kml 7{ 8 import com.google.maps.extras.xmlparsers.Namespaces; 9 import com.google.maps.extras.xmlparsers.ParsingTools; 10 import com.google.maps.extras.xmlparsers.XmlElement; 11 12 /** 13 * Class that represents a <Data> element. 14 * 15 * @see http://code.google.com/apis/kml/documentation/kmlreference.html#data 16 */ 17 public class Data extends Feature 18 { 19 private var _name:String; 20 private var _displayName:String; 21 private var _value:String; 22 23 /** 24 * Constructor for class. 25 * 26 * @param x 27 */ 28 public function Data(x:XMLList) 29 { 30 super(x); 31 this._name = ParsingTools.nullCheck(this.x.attribute(new QName(kml, "name"))); 32 this._displayName = ParsingTools.nullCheck(this.x.kml::displayName); 33 this._value = ParsingTools.nullCheck(this.x.kml::value); 34 } 35 36 /** 37 * Represents the <name> child element. 38 */ 39 public override function get name():String { 40 return this._name; 41 } 42 43 /** 44 * Represents the <displayName> child element. 45 */ 46 public function get displayName():String { 47 return this._displayName; 48 } 49 50 /** 51 * Represents the <value> child element. 52 */ 53 public function get value():String { 54 return this._value; 55 } 56 57 public override function toString():String { 58 return "Data: " + " name: " + this._name + ", value: " + this._value; 59 } 60 } 61}