count.as
来自「用于flash/flex的 as3的 2D图形图像图表的动态生成」· AS 代码 · 共 45 行
AS
45 行
package flare.query
{
/**
* Aggregate operator for counting the number of items in a set of values.
*/
public class Count extends AggregateExpression
{
private var _count:int;
/**
* Creates a new Count operator
* @param input the sub-expression of which to count the value
*/
public function Count(input:*) {
super(input);
}
/**
* @inheritDoc
*/
public override function reset():void
{
_count = 0;
}
/**
* @inheritDoc
*/
public override function eval(o:Object=null):*
{
return _count;
}
/**
* @inheritDoc
*/
public override function aggregate(value:Object):void
{
if (_expr.eval(value) != null) {
_count++;
}
}
} // end of class Count
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?