This function maps a value (index) to a set of constant values (array). If necessary, this function rounds the input value to nearest integer value. Then, it uses the integer value as an index to the set of constant values (array) that are shown as c0, c1, up to cn-1. The c values must be integers. This function checks these values when the expression is parsed and returns cx. If the value is not in the domain from 0 to n-1 (inclusive), the result is 0 (without an error message). Use this function to certify devices.
Syntax
This function has the following format:
Integer snmpConstArrayMap(Double index, Integer[] array)
Parameters
A Double value, which is used as an index into the array.
Any range of integer values.
Return Values
Returns an integer value from the array. An index value of null will return null.
Examples
The following expression produces the following result for an index of 2 and an array of {5, 6, 7, 8, 9, 4}:
Expression:
snmpConstArrayMap (index, array)
Result:
7
The following expression produces the following result for an index of 4.88 and an array of {5, 6, 7, 8, 9, 4}:
Expression:
snmpConstArrayMap (value, array)
Result:
4
Advanced Example
The following expression is taken from “Generic Modem” Vendor Certification:
SpeedOut=snmpConstArrayMap(mdmCsFinalTxLinkRate,{0,110,300,600,1200,2400,4800,7200,9600,12000,14000,16000,19000,38000,75,450,0,57000,21000,24000,26000,28000,0,31000,33000,25333,26666,28000,29333,30666,32000,33333,34666,36000,37333,38666,40000,41333,42666,44000,45333,46666,48000,49333,50666,52000,53333,54666,56000,57333,58666,60000,61333,62666,64000})
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|