-
Notifications
You must be signed in to change notification settings - Fork 1
container.list
load container.list
This module provides the Container.List class which store objects sequentially in memory.
This class creates a list which stores a liste of values and provides an indexes based access and always stores its items sequentially in memory.
Modifiers | Member | Description |
---|---|---|
+ const
|
!= | Returns true if other is not equal to this list; otherwise returns fals ... |
+ const
|
& | Returns a list corresponding to the intersection self and value . |
+ const
|
* | Returns a list with each elements of this list repeated value times. |
+ const
|
+ | Returns a list which is the result of concatenating self and value . |
+ const
|
- | Returns a list with each occurence of value removed. |
+ const
|
<< | Appends value to the list and returns self . |
+ const
|
== | Returns true if other is equal to this list; otherwise returns false . T... |
+ const
|
[] | Returns the elements at the specified index in the list. If index is nega... |
+ const
|
[]= | Replace the elements at the specified index in the list with the elements o... |
+ const
|
append | Inserts value at the end of the list. |
+ const
|
clear | Removes all the elements of the list. |
+ const
|
contains | Returns true if the list contains value ; otherwise returns false . |
+ const
|
count | Returns the number of occurrences of value in the list. |
+ const
|
data | Returns an array containing each elements of the list. |
+ const
|
each | Apply the func function to each elements of the list. |
+ const
|
first | Returns the first element of the list. If the list is empty, an instance of E... |
+ const
|
in | Returns an iterator on the elements of the list. |
+ const
|
indexOf | Returns the index position of the first occurrence of value in the list, se... |
+ const
|
insert | Inserts value in the list at the specified index . If index is negative,... |
+ const
|
isEmpty | Returns true if the list is empty; otherwise returns false . |
+ const
|
last | Returns the last element of the list. If the list is empty, an instance of Ex... |
+ const
|
lastIndexOf | Returns the index position of the last occurrence of value in the list, sea... |
+ const
|
move | Moves the element at index position from to index position to . |
+ const
|
new | Creates a new instance of Container.List. If values is given, the list will... |
+ const
|
prepend | Inserts value at the beginning of the list. |
+ const
|
remove | Removes the element at the given index in the list. |
+ const
|
removeAll | Removes all the occurences of value in the list. |
+ const
|
removeOne | Removes the first occurence of value in the list. |
+ const
|
replace | Replace the elements at the specified index in the list with the elements o... |
+ const
|
size | Returns the number of elements in the list. |
+ const
|
toArray | Converts the list to an array . |
+ const
|
toHash | Converts the list to an hash . |
- final
|
values | Internal values representation. |
def (const self, const other)
Returns true
if other
is not equal to this list; otherwise returns false
.
Two lists are considered equal if they contain the same values in the same order.
This function requires the values to have an implementation of the !=
operator.
def (self, value)
Returns a list corresponding to the intersection self
and value
.
def (self, value)
Returns a list with each elements of this list repeated value
times.
def (self, value)
Returns a list which is the result of concatenating self
and value
.
def (self, value)
Returns a list with each occurence of value
removed.
def (self, value)
Appends value
to the list and returns self
.
def (const self, const other)
Returns true
if other
is equal to this list; otherwise returns false
.
Two lists are considered equal if they contain the same values in the same order.
This function requires the values to have an implementation of the !=
operator.
def (const self, index)
Returns the elements at the specified index
in the list. If index
is
negative, the position is relative to the end of the list.
The index
parameter can either be a number
or an iterator
. This
operator can then be used with a range to extract a sub-set of elements
between two positions.
def (self, index, value)
Replace the elements at the specified index
in the list with the
elements of value
. If index
is negative, the position is relative
to the end of the list.
The index
parameter can either be a number
or an iterator
. This
operator can then be used with a range to replace a sub-set of elements
between two positions.
def (self, value)
Inserts value
at the end of the list.
def (self)
Removes all the elements of the list.
def (const self, value)
Returns true
if the list contains value
; otherwise returns false
.
def (const self, value)
Returns the number of occurrences of value
in the list.
def (const self)
Returns an array
containing each elements of the list.
def (const self, func)
Apply the func
function to each elements of the list.
def (const self)
Returns the first element of the list. If the list is empty, an instance of Exception.NoItem is raised.
def (const self)
Returns an iterator
on the elements of the list.
def (const self, const value)
Returns true
if the list contains value
; otherwise returns false
.
def (const self, value, from = 0)
Returns the index position of the first occurrence of value
in the list,
searching forward from index position from
. Returns none
if no element
matched.
def (self, index, value)
Inserts value
in the list at the specified index
. If index
is
negative, the position is relative to the end of the list. If index
is
not a valid index of the list (ie. index
is not contained in the range
0...size), an instance of Exception.OutOfRange is raised.
def (const self)
Returns true
if the list is empty; otherwise returns false
.
def (const self)
Returns the last element of the list. If the list is empty, an instance of Exception.NoItem is raised.
def (const self, value, from = none)
Returns the index position of the last occurrence of value
in the list,
searching backward from index position from
. Returns none
if no
element matched.
def (self, from, to)
Moves the element at index position from
to index position to
.
def (self, values = [])
Creates a new instance of Container.List. If values
is given, the
list will be initialized with the given values.
def (self, value)
Inserts value
at the beginning of the list.
def (self, index)
Removes the element at the given index
in the list.
def (self, value)
Removes all the occurences of value
in the list.
def (self, value)
Removes the first occurence of value
in the list.
def (self, index, value)
Replace the elements at the specified index
in the list with the
elements of value
. If index
is negative, the position is relative
to the end of the list. If index
is not a valid index of the list (ie.
index
is not contained in the range 0...size), an instance of
Exception.OutOfRange is raised.
def (const self)
Returns the number of elements in the list.
def (const self)
Converts the list to an array
.
def (const self)
Converts the list to an hash
.
[]
Internal values representation.
Language reference
- Introduction
- Variables
- Built-in types
- Arithmetic operations
- Type casting
- Control structures
- Function definition
- User defined types
- Work with modules
Library reference