Packagecom.esri.bacore.thematicmapping
Classpublic class TMValueCalculator
InheritanceTMValueCalculator Inheritance ValueCalculator Inheritance flash.events.EventDispatcher

The TMValueCalculator class calculates the value of a feature for thematic shading using one of the calculation methods specified with the TMValueType enumeration.

See also

TMValueType


Public Properties
 PropertyDefined By
  averageBaseFieldAlias : String
[read-only] Alias name of the field to calculate an average by.
TMValueCalculator
  averageBaseFieldName : String
[read-only] Name of the field to calculate an average by.
TMValueCalculator
  baseFieldAlias : String
Alias name of the base field.
TMValueCalculator
  baseFieldName : String
[read-only] Name of the base field.
TMValueCalculator
  decimals : int
[override] [read-only] The number of significant digits after the decimal point for a value calculated by this calculator.
TMValueCalculator
 Inheritedformatter : IValueFormatter
Value formatter to be used to format values.
ValueCalculator
  indexBase : Number
[read-only] Base value for index calculation (NaN or zero value means no index base).
TMValueCalculator
  percentageFieldAlias : String
[read-only] Alias name of the field to calculate percentage by.
TMValueCalculator
  percentageFieldName : String
[read-only] Name of the field to calculate percentage by.
TMValueCalculator
  valueCalculationType : TMValueType
Current value-calculation method.
TMValueCalculator
  valueType : BAValueType
[override] [read-only] The type of the current thematic value.
TMValueCalculator
Public Methods
 MethodDefined By
  
TMValueCalculator(summarizations:TMSummarizations, baseFieldName:String, percentFieldName:String = null, averageBaseFieldName:String = null, indexBase:Number)
Creates a new instance of the ValueCalculator class.
TMValueCalculator
  
calculate(attributes:Object, provider:TMAttributesProvider):Number
[override] Calculates a value to thematically shade the given feature by.
TMValueCalculator
 Inherited
createBaseDescriptionFields(attributes:Object, provider:TMAttributesProvider, descriptionStyle:ValueDescriptionStyle):Array
[static] Creates base description fields for a graphic feature.
ValueCalculator
  
createDescriptionFields(attributes:Object, provider:TMAttributesProvider, descriptionStyle:ValueDescriptionStyle):Array
[override] Creates a list of fields describing value calculation properties.
TMValueCalculator
 Inherited
createTMValueFormat(formatWithUnits:Boolean):ValueFormat
Creates a format for formatting the thematic value.
ValueCalculator
  
[override] Gets an array of names of summarization fields which are required for value calculation.
TMValueCalculator
  
Tests this calculator to support the given summarization type.
TMValueCalculator
Events
 Event Summary Defined By
 InheritedThe calculationMethodChanged event is dispatched when the method of value calculation is changed.ValueCalculator
Public Constants
 ConstantDefined By
 InheritedCALCULATION_METHOD_CHANGED : String = calculationMethodChanged
[static] The ValueCalculator.CALCULATION_METHOD_CHANGED constant defines the value of the type property of the flash.events.Event object for a calculationMethodChanged event.
ValueCalculator
Property Detail
averageBaseFieldAliasproperty
averageBaseFieldAlias:String  [read-only]

Alias name of the field to calculate an average by.


Implementation
    public function get averageBaseFieldAlias():String
averageBaseFieldNameproperty 
averageBaseFieldName:String  [read-only]

Name of the field to calculate an average by.


Implementation
    public function get averageBaseFieldName():String
baseFieldAliasproperty 
baseFieldAlias:String

Alias name of the base field.


Implementation
    public function get baseFieldAlias():String
    public function set baseFieldAlias(value:String):void
baseFieldNameproperty 
baseFieldName:String  [read-only]

Name of the base field.


Implementation
    public function get baseFieldName():String
decimalsproperty 
decimals:int  [read-only] [override]

The number of significant digits after the decimal point for a value calculated by this calculator. Negative value means unknown number of significant digits.


Implementation
    public function get decimals():int
indexBaseproperty 
indexBase:Number  [read-only]

Base value for index calculation (NaN or zero value means no index base).


Implementation
    public function get indexBase():Number
percentageFieldAliasproperty 
percentageFieldAlias:String  [read-only]

Alias name of the field to calculate percentage by.


Implementation
    public function get percentageFieldAlias():String
percentageFieldNameproperty 
percentageFieldName:String  [read-only]

Name of the field to calculate percentage by.


Implementation
    public function get percentageFieldName():String
valueCalculationTypeproperty 
valueCalculationType:TMValueType

Current value-calculation method.


Implementation
    public function get valueCalculationType():TMValueType
    public function set valueCalculationType(value:TMValueType):void
valueTypeproperty 
valueType:BAValueType  [read-only] [override]

The type of the current thematic value.


Implementation
    public function get valueType():BAValueType
Constructor Detail
TMValueCalculator()Constructor
public function TMValueCalculator(summarizations:TMSummarizations, baseFieldName:String, percentFieldName:String = null, averageBaseFieldName:String = null, indexBase:Number)

Creates a new instance of the ValueCalculator class.

The percentFieldName and averageBaseFieldName parameters are mutually exclusive. Only one of them can be specified.

Parameters
summarizations:TMSummarizations — Name of the base field.
 
baseFieldName:String — Name of the field to calculate percentage by.
 
percentFieldName:String (default = null) — Name of the field to calculate an average by.
 
averageBaseFieldName:String (default = null) — Base value for index calculation (NaN or zero value means no index base).
 
indexBase:Number (default = NaN)
Method Detail
calculate()method
override public function calculate(attributes:Object, provider:TMAttributesProvider):Number

Calculates a value to thematically shade the given feature by.

Parameters

attributes:Object — Attributes of a feature.
 
provider:TMAttributesProvider — Provider of thematic mapping attributes.

Returns
Number — The value calculated.
createDescriptionFields()method 
override public function createDescriptionFields(attributes:Object, provider:TMAttributesProvider, descriptionStyle:ValueDescriptionStyle):Array

Creates a list of fields describing value calculation properties.

The table below shows the avaiability and precedence of the description fields which appear in the output list depending on the ValueDescriptionStyle used.

FieldNONESIMPLESHORTLONG
"ID"nonoyesyes
"Name"nonoyesyes
"Value"noyesyesyes
"TMBAValueType"nononoyes
"TMVarID"nononoyes
"TMVarName"nononoyes
"TMVarValue"nononoyes
"PercentageVarID"nononoyes?
"PercentageVarName"nononoyes?
"PercentageVarValue"nononoyes?
"AverageBaseVarID"nononoyes?
"AverageBaseVarName"nononoyes?
"AverageBaseVarValue"nononoyes?
"IndexBaseValue"nononoyes?

Parameters

attributes:Object — Attributes of feature to get values from.
 
provider:TMAttributesProvider — Provider of thematic mapping attributes (can be null).
 
descriptionStyle:ValueDescriptionStyle — Value description style.

Returns
Array — An array of feature description fields containing KeyValuePair items.

See also

getSummarizationFields()method 
override public function getSummarizationFields():Array

Gets an array of names of summarization fields which are required for value calculation.

Returns
Array — The array of String items containing names of required summarization fields.
isEnabledTMValueType()method 
public function isEnabledTMValueType(type:TMValueType):Boolean

Tests this calculator to support the given summarization type.

Parameters

type:TMValueType — Summarization type requested.

Returns
Boolean — True if this summarization type is allowed.