Packagecom.esri.bacore
Classpublic final class CoreUtils
InheritanceCoreUtils Inheritance Object

The CoreUtils class contains a collection of static core utility methods.



Public Methods
 MethodDefined By
  
addUrlVariable(url:String, name:String, value:String):String
[static] Adds a variable to the query part of URL.
CoreUtils
  
copyOfArrayOfNumber(array:Array):Array
[static] Creates a copy of array of numbers.
CoreUtils
  
copyOfArrayOfString(array:Array):Array
[static] Creates a copy of array of string.
CoreUtils
  
isNonemptyArray(value:Object):Boolean
[static] Tests that the given object is a nonempty array.
CoreUtils
  
isSpecified(value:Object):Boolean
[static] Tests a value to be specified.
CoreUtils
  
nonNullString(parameter:String, defaultValue:String):String
[static] Tests the parameter to be non-null string and returns either input value or the defaultValue if the parameter is null.
CoreUtils
  
toHttpsUrl(url:String):String
[static] Converts nonsecured HTTP URL to HTTPS URL.
CoreUtils
  
toJsonArray(array:Array):Array
[static] Converts an array of items to an array of objects to be serialized with ArcGIS JSON encoder.
CoreUtils
  
toSimpleList(array:Array):String
[static] Convert an array of items to a simple list.
CoreUtils
Method Detail
addUrlVariable()method
public static function addUrlVariable(url:String, name:String, value:String):String

Since : Community Analyst API for Flex 2.2.

Adds a variable to the query part of URL.

Parameters

url:String — Input URL.
 
name:String — Variable name.
 
value:String — Variable value.

Returns
String — Output URL.
copyOfArrayOfNumber()method 
public static function copyOfArrayOfNumber(array:Array):Array

Creates a copy of array of numbers. If the array contains null values or values convertible to the NaN value, the ArgumentError error is thrown.

Parameters

array:Array — Array containing numeric values (can be null).

Returns
Array — Copy of input array or an empty array if the input array is null.
copyOfArrayOfString()method 
public static function copyOfArrayOfString(array:Array):Array

Creates a copy of array of string. If the array contains null values or values of non-string type, the ArgumentError error is thrown.

Parameters

array:Array — Array containing string values (can be null).

Returns
Array — Copy of input array or an empty array if the input array is null.
isNonemptyArray()method 
public static function isNonemptyArray(value:Object):Boolean

Tests that the given object is a nonempty array.

Parameters

value:Object — An object to be tested or null.

Returns
Boolean — True if this is a enumerable object and its length property is nonzero.
isSpecified()method 
public static function isSpecified(value:Object):Boolean

Tests a value to be specified. A value isn't specified if it is either null or an empty string or an empty array.

Parameters

value:Object — A value to test.

Returns
Boolean — True if the value is specified.
nonNullString()method 
public static function nonNullString(parameter:String, defaultValue:String):String

Tests the parameter to be non-null string and returns either input value or the defaultValue if the parameter is null.

Parameters

parameter:String — A parameter string.
 
defaultValue:String — A value returned for a null input string.

Returns
String — Input value or the default value.
toHttpsUrl()method 
public static function toHttpsUrl(url:String):String

Converts nonsecured HTTP URL to HTTPS URL.

If the input URL is null or its protocol is not "http", the input URL is returned. When converted, the "http" protocol is replaced with "https", port 80 is replaced with 443, and port 8080 is replaced with 8443.

Parameters

url:String — Input URL or null.

Returns
String — HTTPS URL or an original URL if it is non-HTTP URL.
toJsonArray()method 
public static function toJsonArray(array:Array):Array

Converts an array of items to an array of objects to be serialized with ArcGIS JSON encoder.

This method recognizes array-type items, BaseEnum-type items or items implementing the IJsonObject interface and provides the proper conversion of them. Other objects are pushed to the output array as is.

Parameters

array:Array — An input array to be converted.

Returns
Array — A new array with converted objects.

See also

toSimpleList()method 
public static function toSimpleList(array:Array):String

Convert an array of items to a simple list.

Parameters

array:Array — An input array to be converted.

Returns
String — A string containing a list of items separated with semicolon.