PageRenderTime 30ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/src/com/google/maps/extras/xmlparsers/kml/Data.as

http://gmaps-utility-library-flash.googlecode.com/
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. */
  6. package 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. * Class that represents a <Data> element.
  13. *
  14. * @see http://code.google.com/apis/kml/documentation/kmlreference.html#data
  15. */
  16. public class Data extends Feature
  17. {
  18. private var _name:String;
  19. private var _displayName:String;
  20. private var _value:String;
  21. /**
  22. * Constructor for class.
  23. *
  24. * @param x
  25. */
  26. public function Data(x:XMLList)
  27. {
  28. super(x);
  29. this._name = ParsingTools.nullCheck(this.x.attribute(new QName(kml, "name")));
  30. this._displayName = ParsingTools.nullCheck(this.x.kml::displayName);
  31. this._value = ParsingTools.nullCheck(this.x.kml::value);
  32. }
  33. /**
  34. * Represents the <name> child element.
  35. */
  36. public override function get name():String {
  37. return this._name;
  38. }
  39. /**
  40. * Represents the <displayName> child element.
  41. */
  42. public function get displayName():String {
  43. return this._displayName;
  44. }
  45. /**
  46. * Represents the <value> child element.
  47. */
  48. public function get value():String {
  49. return this._value;
  50. }
  51. public override function toString():String {
  52. return "Data: " + " name: " + this._name + ", value: " + this._value;
  53. }
  54. }
  55. }