包 | com.supermap.web.ogc.wfs |
类 | public class Arithmetic |
继承 | Arithmetic ![]() ![]() |
该类用于定义算述运算规则,既可直接用作 GetWFSFeature 类的过滤条件,也可用于定义表达式。实现代码如下:
Example1:
var arithmetic1:Arithmetic = new Arithmetic();
arithmetic1.type = ArithmeticType.DIV;
arithmetic1.propertyNames = ["SmArea","SmPerimeter"];
Example1 实例用于实现简单运算:SmArea / SmPerimeter。
Example2:下面代码在 Example1 实例的基础上实现:SmLength - SmArea / SmPerimeter
var arithmetic2:Arithmetic = new Arithmetic();
arithmetic2.type = ArithmeticType.SUB;
arithmetic2.propertyNames = ["SmLength"];
arithmetic2.expressions = [arithmetic1];
Example3:在 Example2 实例中 SmLength 做为被减数,SmArea / SmPerimeter 作为减数,即 expressions 表达式所代表的是操作对象;那么反过来,如何实现 SmArea / SmPerimeter - SmLength 呢?解决该问题需要将算式转换为:0 -(SmLength - SmArea / SmPerimeter) 进行处理,在 Example1、Example2 的基础上实现代码如下:
var arithmetic3:Arithmetic = new Arithmetic();
arithmetic3.type = ArithmeticType.SUB;
arithmetic3.value = 0;
arithmetic3.expressions = [arithmetic2];
另请参见
属性 | 定义方 | ||
---|---|---|---|
expressions : Array
表达式集合(表达式分三种:字段名、值、四则运算),该集合中的对象只能是 Arithmetic 类型。
|
Arithmetic | ||
propertyNames : Array
字段集合。
|
Arithmetic | ||
type : String
算术运算类型。
|
Arithmetic | ||
value : String
值。
|
Arithmetic |
方法 | 定义方 | ||
---|---|---|---|
实例化 Arithmetic 对象。
|
Arithmetic |
expressions | 属性 |
expressions:Array
表达式集合(表达式分三种:字段名、值、四则运算),该集合中的对象只能是 Arithmetic 类型。
public function get expressions():Array
public function set expressions(value:Array):void
propertyNames | 属性 |
propertyNames:Array
字段集合。
public function get propertyNames():Array
public function set propertyNames(value:Array):void
type | 属性 |
type:String
算术运算类型。
public function get type():String
public function set type(value:String):void
value | 属性 |
value:String
值。
public function get value():String
public function set value(value:String):void
Arithmetic | () | 构造函数 |
public function Arithmetic()
实例化 Arithmetic 对象。