Constructor
new ArrayList(arr, offset, total)
Creates a new ArrayList instance.
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | The array (or a subsection of an array) to wrap |
offset |
Number | An optional offset to use (mandatory if the array is just a subsection). |
total |
Number | An optional total size of the array. This argument is mandatory if the wrapped array is just a subsection. |
- Source:
Returns:
A newly created ArrayList instance
Members
length :Number
The length of this ArrayList instance.
Type:
- Number
- Source:
offset :Number
The offset of this ArrayList instance. This might be > zero for
ArrayList instances wrapping just a subsection, that is
mimicking a bigger list.
Type:
- Number
- Source:
Methods
get(idx)
Returns the element at the index position passed
as argument. If the wrapped array is just a subsection
the index position passed will be corrected using
the offset.
Parameters:
Name | Type | Description |
---|---|---|
idx |
Number | The index position of the element to return |
- Source:
Returns:
The element at the given index position
isSubset()
Returns true if this ArrayList is a subsection of a bigger array
- Source:
Returns:
True if this ArrayList is a subsection of a bigger array
size()
Returns the size of this ArrayList, which is either
the length of the wrapped array or the total size
passed as argument to the constructor (in case the wrapped
array is just a subsection).
- Source:
Returns:
The size of this ArrayList instance
subsetSize()
Returns the actual size of this ArrayList's wrapped array.
- Source:
Returns:
The actual size of this ArrayList's wrapped array.