_global_
Class Array

java.lang.Object
  extended by _global_.Array
Direct Known Subclasses:
Offset, Size

public class Array
extends java.lang.Object

An array is a special variable, whcih can hold more than one value.

In additions to JavaScript Reference that JavaScript provide, ZK extends with the following methods.

To test if an object is an array, use jq.isArray(obj) where obj can be null.

See Also:
Map, String, Dimension, Offset

Method Summary
 void $addAll(Array ary)
          Adds all elements of the given array to this array.
 Array $clone()
          Clones this array.
 boolean $contains(java.lang.Object o)
          Returns true if this list contains the specified element.
 boolean $equals(java.lang.Object o)
          Returns whether obj is an array, the length is the same, and each element in obj is the same as each element of this array.
 int $indexOf(java.lang.Object o)
          Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
 boolean $remove(java.lang.Object o)
          Removes the specified object from this array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

$clone

public Array $clone()
Clones this array.

For example,

var anotherArray = ary.$clone();


$indexOf

public int $indexOf(java.lang.Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.


$contains

public boolean $contains(java.lang.Object o)
Returns true if this list contains the specified element.


$remove

public boolean $remove(java.lang.Object o)
Removes the specified object from this array.

Returns:
whether the object is removed successfully.

$equals

public boolean $equals(java.lang.Object o)
Returns whether obj is an array, the length is the same, and each element in obj is the same as each element of this array. It will compare recursively.

For example,

[0, ["s"]].$equals([0, ["s"]]) //is true

Notice that == returns false in the above case.


$addAll

public void $addAll(Array ary)
Adds all elements of the given array to this array.

Since:
5.0.4


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo