Packagecom.esri.bacore.thematicmapping
Classpublic class TMAttributesProvider
InheritanceTMAttributesProvider Inheritance Object

The TMAttributesProvider class provides an access to attributes of a feature of a thematic layer.



Public Properties
 PropertyDefined By
  actualValueCalculator : ValueCalculator
[read-only] Value calculator actually used in calculation of thematic mapping values.
TMAttributesProvider
  layer : TMLayer
[read-only] Owner layer of this provider.
TMAttributesProvider
Public Methods
 MethodDefined By
  
TMAttributesProvider(layer:TMLayer, actualCalculator:ValueCalculator, idField:String, nameField:String)
Creates a new instance of the TMAttributesProvider class.
TMAttributesProvider
  
calculateTMValue(attributes:Object):Number
Calculates thematic mapping value using the actual value calculator.
TMAttributesProvider
  
createDescription(attributes:Object, descriptionStyle:ValueDescriptionStyle):Object
Creates fields describing value calculation properties.
TMAttributesProvider
  
createDescriptionFields(attributes:Object, descriptionStyle:ValueDescriptionStyle):Array
Creates a list of fields describing value calculation properties.
TMAttributesProvider
  
createTMValueFormat(formatWithUnits:Boolean):ValueFormat
Creates a format for formatting the thematic value.
TMAttributesProvider
  
getFeatureID(attributes:Object):String
Gets the feature ID.
TMAttributesProvider
  
getFeatureName(attributes:Object):String
Gets the feature name.
TMAttributesProvider
  
getNumber(attributes:Object, name:String):Number
Gets the given feature attribute as a number.
TMAttributesProvider
  
getTMValue(attributes:Object):Number
Gets the thematic mapping value.
TMAttributesProvider
  
getValue(attributes:Object, name:String, defaultValue:*, nullValue:* = null):*
Gets the given feature attribute.
TMAttributesProvider
Property Detail
actualValueCalculatorproperty
actualValueCalculator:ValueCalculator  [read-only]

Value calculator actually used in calculation of thematic mapping values.


Implementation
    public function get actualValueCalculator():ValueCalculator
layerproperty 
layer:TMLayer  [read-only]

Owner layer of this provider.


Implementation
    public function get layer():TMLayer
Constructor Detail
TMAttributesProvider()Constructor
public function TMAttributesProvider(layer:TMLayer, actualCalculator:ValueCalculator, idField:String, nameField:String)

Creates a new instance of the TMAttributesProvider class.

The nameField parameter is optional. If it is null or empty, the idField parameter value is used as a name field.

Parameters
layer:TMLayer — Owner layer of this provider.
 
actualCalculator:ValueCalculator — Name of field representing a feature ID.
 
idField:String — Name of field representing a feature name (optional, can be null).
 
nameField:String
Method Detail
calculateTMValue()method
public function calculateTMValue(attributes:Object):Number

Calculates thematic mapping value using the actual value calculator. If the value calculator is missing, NaN is returned.

Parameters

attributes:Object — Attributes of a graphic feature.

Returns
Number — Thematic mapping value.
createDescription()method 
public function createDescription(attributes:Object, descriptionStyle:ValueDescriptionStyle):Object

Creates fields describing value calculation properties.

Parameters

attributes:Object — A graphic to create description fields for.
 
descriptionStyle:ValueDescriptionStyle — Value description style.

Returns
Object — A new object with description fields.
createDescriptionFields()method 
public function createDescriptionFields(attributes:Object, descriptionStyle:ValueDescriptionStyle):Array

Creates a list of fields describing value calculation properties.

Parameters

attributes:Object — Attributes of feature to get values from.
 
descriptionStyle:ValueDescriptionStyle — Value description style.

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

See also

createTMValueFormat()method 
public function createTMValueFormat(formatWithUnits:Boolean):ValueFormat

Creates a format for formatting the thematic value.

Parameters

formatWithUnits:Boolean — True value means formatting with units.

Returns
ValueFormat — A new value format.
getFeatureID()method 
public function getFeatureID(attributes:Object):String

Gets the feature ID.

Parameters

attributes:Object — Attributes of a graphic feature.

Returns
String — Feature ID or an empty string if the feature ID attribute is missing.
getFeatureName()method 
public function getFeatureName(attributes:Object):String

Gets the feature name.

Parameters

attributes:Object — Attributes of a graphic feature.

Returns
String — Feature name or an empty string if the feature name attribute is missing.
getNumber()method 
public function getNumber(attributes:Object, name:String):Number

Gets the given feature attribute as a number.

If the attribute value is missing, it is converted to zero or NaN depending on the value of showMissingValuesAsZeroes property of an associated thematic layer. If the attribute value is null (this is the special case of supressions in data), the NaN value is returned.

Parameters

attributes:Object — Attributes of a graphic feature.
 
name:String — Name of requested attribute field.

Returns
Number — Value of the attribute.
getTMValue()method 
public function getTMValue(attributes:Object):Number

Gets the thematic mapping value.

Parameters

attributes:Object — Attributes of a graphic feature.

Returns
Number — Thematic mapping value or NaN if thematic mapping value is missing.
getValue()method 
public function getValue(attributes:Object, name:String, defaultValue:*, nullValue:* = null):*

Gets the given feature attribute.

Parameters

attributes:Object — Attributes of a graphic feature.
 
name:String — Name of requested attribute field.
 
defaultValue:* — Default value to be returned if the attribute is missing.
 
nullValue:* (default = null) — A value to be returned if the attribute is null (since Community Analyst API for Flex 2.2).

Returns
* — Value of the attribute or the default value.