PageRenderTime 37ms CodeModel.GetById 27ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://gmaps-utility-library-flash.googlecode.com/
ActionScript | 119 lines | 64 code | 16 blank | 39 comment | 0 complexity | a86a38c63f894b44fcf4d56d3616e66d 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	*	Base class for Icon and Link. Both contain exactly the same child elements.
 14	*     and are different only in where they're used.
 15	*/
 16	public class AbstractLink extends KmlObject
 17	{
 18		//todo: add constants for the enum values?
 19		private var _href:String;
 20		private var _refreshMode:String;
 21		private var _refreshInterval:Number;
 22		private var _viewRefreshMode:String;
 23		private var _viewRefreshTime:Number;
 24		private var _viewBoundScale:Number;
 25		private var _viewFormat:String;
 26		private var _httpQuery:String;
 27	
 28		/**
 29		*	Constructor for class.
 30		* 
 31		*	@param x
 32		*/	
 33		public function AbstractLink(x:XMLList)
 34		{
 35			super(x);
 36			
 37			this._href = ParsingTools.nullCheck(this.x.kml::href);
 38			this._refreshMode = ParsingTools.nullCheck(this.x.kml::refreshMode);
 39			this._refreshInterval = ParsingTools.nanCheck(this.x.kml::refreshInterval);
 40			this._viewRefreshMode = ParsingTools.nullCheck(this.x.kml::viewRefreshMode);
 41			this._viewRefreshTime = ParsingTools.nanCheck(this.x.kml::viewRefreshTime);
 42			this._viewBoundScale = ParsingTools.nanCheck(this.x.kml::viewBoundScale);
 43			this._viewFormat = ParsingTools.nullCheck(this.x.kml::viewFormat);
 44			this._httpQuery = ParsingTools.nullCheck(this.x.kml::httpQuery);
 45		}
 46
 47		/**
 48		*	Represents <href> child element.
 49		*/	
 50		public function get href():String
 51		{
 52			return this._href;
 53	 	}
 54	 	
 55		/**
 56		*	Represents <refreshMode> child element.
 57		*/	
 58		public function get refreshMode():String
 59		{
 60			return this._refreshMode;
 61	 	} 	
 62	 	
 63	 		 	
 64		/**
 65		*	Represents <refreshInterval> child element.
 66		*/	
 67		public function get refreshInterval():Number
 68		{
 69			return this._refreshInterval;
 70	 	} 	
 71	 	
 72	 		 	
 73		/**
 74		*	Represents <viewRefreshMode> child element.
 75		*/	
 76		public function get viewRefreshMode():String
 77		{
 78			return this._viewRefreshMode;
 79	 	} 	
 80	 	
 81	 		 	
 82		/**
 83		*	Represents <viewRefreshTime> child element.
 84		*/	
 85		public function get viewRefreshTime():Number
 86		{
 87			return this._viewRefreshTime;
 88	 	} 	
 89	 	
 90	 		 	
 91		/**
 92		*	Represents <viewBoundScale> child element.
 93		*/	
 94		public function get viewBoundScale():Number
 95		{
 96			return this._viewBoundScale;
 97	 	} 	
 98	 	
 99		/**
100		*	Represents <viewFormat> child element.
101		*/	
102		public function get viewFormat():String
103		{
104			return this._viewFormat;
105	 	} 		 	
106	 	
107	 	/**
108		*	Represents <httpQuery> child element.
109		*/	
110		public function get httpQuery():String
111		{
112			return this._httpQuery;
113	 	} 	
114	 	
115	 	public override function toString():String {
116	 		return "AbstractLink: " + "href: " + this._href;
117	 	}
118	}
119}