EMS.Array

Contains convenience functions for array manipulation.  This extends OpenLayers.Array.

Summary
EMS.ArrayContains convenience functions for array manipulation.
Static Functions
containsSearches an array for a given item.
containsAll
clearClears an array of all items.
removeRemoves the first instance of the given item.
cloneMakes a shallow copy of the array.

Static Functions

contains

EMS.Array.contains = function(array,
item,
from)

Searches an array for a given item.  It will return true if it contains at least one of the given items.

Parameters

array{Array} is the array to test.
item{Object} is the object to search for.
from{Integer} is the optional starting index to search from.

Returns

{Boolean} Returns true if the array contains the given item.

containsAll

EMS.Array.containsAll = function(array,
items)

Parameters

array{Array} is the array to search.
items{Array} is the array of items to search for.

Returns

{Boolean} Returns true if the array contains all the items.

clear

EMS.Array.clear = function(array)

Clears an array of all items.

Returns

{Array} Returns the array.

remove

EMS.Array.remove = function(array,
item)

Removes the first instance of the given item.

Parameters

array{Array} is the array to search and remove from.
item{Object} is the object to remove.

Returns

{Boolean} Returns true if the item was found and removed.

clone

EMS.Array.clone = function(array)

Makes a shallow copy of the array.

Parameters

array{Array} is the array to clone.

Returns

{Array} Returns a clone of the input array.

EMS.Array.contains = function(array,
item,
from)
Searches an array for a given item.
EMS.Array.containsAll = function(array,
items)
EMS.Array.clear = function(array)
Clears an array of all items.
EMS.Array.remove = function(array,
item)
Removes the first instance of the given item.
EMS.Array.clone = function(array)
Makes a shallow copy of the array.
Contains convenience functions for array manipulation.
Close