scaletype.as

来自「用于flash/flex的 as3的 2D图形图像图表的动态生成」· AS 代码 · 共 55 行

AS
55
字号
package flare.scale
{
	/**
	 * Constants defining known scale types, such as linear, log, and
	 * date/time scales.
	 */
	public class ScaleType
	{
		/** Constant indicating an unknown scale. */
		public static const UNKNOWN:String = "unknown";
		/** Constant indicating a categorical scale. */
		public static const CATEGORIES:String = "categories";
		/** Constant indicating an ordinal scale. */
		public static const ORDINAL:String = "ordinal";
		/** Constant indicating a linear numeric scale. */
		public static const LINEAR:String = "linear";
		/** Constant indicating a root-transformed numeric scale. */
		public static const ROOT:String = "root";
		/** Constant indicating a log-transformed numeric scale. */
		public static const LOG:String = "log";
		/** Constant indicating a quantile scale. */
		public static const QUANTILE:String = "quantile";
		/** Constant indicating a date/time scale. */
		public static const TIME:String = "time";
		
		/**
		 * Constructor, throws an error if called, as this is an abstract class.
		 */
		public function ScaleType() {
			throw new Error("This is an abstract class.");
		}
		
		/**
		 * Tests if a given scale type indicates an ordinal scale 
		 * @param type the scale type
		 * @return true if the type indicates an ordinal scale, false otherwise
		 */
		public static function isOrdinal(type:String):Boolean
		{
			return type==ORDINAL || type==CATEGORIES;
		}
		
		/**
		 * Tests if a given scale type indicates a quantitative scale 
		 * @param type the scale type
		 * @return true if the type indicates a quantitative scale,
		 *  false otherwise
		 */
		public static function isQuantitative(type:String):Boolean
		{
			return type==LINEAR || type==ROOT || type==LOG;
		}
		
	} // end of class ScaleType
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?