Class nokia.maps.util.Strip
Class Summary
This class represents a special array that contains objects, all of the same type, and each with the same properties. The objects are not added to the array as objects, but instead the array contains just the values of the properties of the objects. Each object is allocated one slot in the array for every property it contains. For example, if each object in the array has two properties called "x" and "y", then the length of the array is twice the number of objects added to it.
new nokia.maps.util.Strip
(names, [data])
Method Summary
static
stencil
(template, [data])
This method creates a new instance of
Strip by reusing the meta data of an existing strip object and an optional data array.
Field Summary
static
nokia.maps.util.Strip
LAT_LNG
This property is a template for ["latitude", "longitude"] strips.
static
nokia.maps.util.Strip
X_Y
This property is a template for ["x", "y"] strips.
Object[]
data
This property holds the array values.
String[]
names
This property holds an array of the names of the properties defined on each of the objects in the strip.
Object
offsets
This hashtable holds the relative offset of each object property held in the array (from 0 to n-1).
Constructor Detail
Method Detail
static
stencil
(template, [data])
This method creates a new instance of
Strip by reusing the
meta data of an existing strip object and an optional data array.
Examples:
strip1 = new Strip(["foo", "bar"], foobar1); strip2 = Strip.stencil(strip1, foobar2);
Parameters:
| {nokia.maps.util.Strip} | template |
A Strip to be used
as a template for creating a new instance of Strip
|
| {Object[]} | [data]: [] | An array of data with which to populate the new instance |
Field Detail
static
nokia.maps.util.Strip
LAT_LNG
This property is a template for ["latitude", "longitude"] strips.
Object[]
data
This property holds the array values. To get the number of objects contained in the
array, the length of the data array must be divided by the length of the
names property, so:
size = arr.data.length / arr.names.length;
