Series is a set of items organized in an specific order. There is no
restrictions related to duplicates, and does not perform (in an
automatic manner) any ordering (unless wonted) of the elements. A series
can also contain any kind of data type including other series.
The number of items this Series contains.
$list = "one;two;three".getTokens(";")
print $list@length
3
$list1 typeof Series
$list1.add("one")
$list1.add("two")
$list1.add("red,blue".getTokens(","))
print $list1@length
3
The current position of the cursor in the Series, also used to move the
cursor at the wanted position.
$list = "one;two;three".getTokens(";")
PRINT $list@index
0
PRINT $list/$list.index
one
PRINT $list/2
two
$list@index = 3
$nr=$list@index
PRINT $list/$nr
three
Specify whenever the index represents the last element of the series or
not.
$list = "one;two;three".getTokens(";")
PRINT $list@hasNext
true
$list@index = 3
PRINT $list@hasNext
false
Specify whenever the index represents the first element of the series or
not.
$list = "one;two;three".getTokens(";")
PRINT $list@hasPrevious
false
$list@index = 3
PRINT $list@hasPrevious
true
Label: | Has next |
Type: | Logical |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify whenever the index represents the last element of the series or not.
Label: | Has previous |
Type: | Logical |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify whenever the index represents the first element of the series or
not.
Label: | Index |
Type: | Integer |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify the current position of the cursor in the Series, also used to
move the cursor at the wanted position. Initially the index is
positioned at the first element of the series.
Label: | Length |
Type: | Integer |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify the number of items this Series contains.
If the concept argument occurs in this Series then his index is
returned, else -1 returned.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.indexOf("blue")
-- the result is --
3
Parameters: |
$value : | The concept to add. |
|
Appends the concept given as parameter to the end of this Series.
$s typeof Series
$s.add("red")
$s.add("green")
print $s
$s.add("blue")
print $s
-- the result is --
red
green
red
green
blue
Returns true if this Series contains the specified concept, false
otherwise.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.contains("blue")
-- the result is --
true
Returns the concept from the position to which the index point.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
$s.setIndex(2)
print $s.current
-- the result is --
green
Parameters: |
$position : | The index of the required item. |
|
Returns the concept at the specified position or nil
if the
position doesn't exist.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.elementAt(3)
-- the result is --
blue
Exceptions: |
noSuchElement :
(Warning) | If the concept does not have such an Element. |
Returns the element with the specified name if it can be found in this
Series, nil otherwise.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.getConceptElement("string")
-- the result is --
red
green
blue
Returns a Series containing elements of type String with the name of the
elements defined in this concept.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.getConceptElements
-- the result is --
red
green
blue
Parameters: |
$index : | The position at which to insert the Concept. |
$value : | The Concept to be added. |
|
Adds the specified Concept to this Series at the given position.
$s typeof Series
$s.add("red")
$s.add("green")
$s.insert(2, "blue")
print $s
-- the result is --
red
blue
green
Parameters: |
$value : | The Concept to be added. |
|
Adds the specified component to the end of this Series.
$s typeof Series
$s.insert("red")
$s.insert("green")
$s.insert("blue")
print $s
-- the result is --
red
green
blue
Returns the next element after the one marked by the index of the series
and sets the index on it.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.next
print $s.next
-- the result is --
red
green
Returns the element before the one marked by the index of the series and
sets the index on it.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
$s.setIndex(3)
print $s.previous
print $s.previous
-- the result is --
green
red
Removes the element marked by the index and sets the index on the next
element, if it is available, on the previous one if it is not.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
$s.setIndex(2)
$s.remove
print $s
-- the result is --
red
blue
Removes the element marked by the parameter and sets the index on the next
element, if it is available, on the previous one if it is not.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
$s.remove(2)
print $s
-- the result is --
red
blue
Sets the index value to the given value.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
$s.setIndex(1)
print $s.current
$s.setIndex(3)
print $s.current
-- the result is --
red
blue
Parameters: |
$index : | The index of the value to be replaced. |
$newValue : | The new value. |
|
Sets the value at the position specified by the $index parameter to the new value.
$ser typeof Series
$ser.add("red")
$ser.add("yellow")
$ser.add("blue")
print $ser
$ser.setValue(2, "green")
print $ser
-- the result is --
red
yellow
blue
red
green
blue
Parameters: |
$sorter : |
Any SorterConcept. The SorterConcept is a simple concept which contains
at least one method which accepts two concepts as parameters and produce
an integer which has a value of zero if the concepts are equals, +1 if
the first concept is greater than the second and -1 if the first concept
is less than the second. In this way we can provide a simple way to
allow anybody to produce their own sorting methods specially fitted for
their problems and data types.
|
|
Sorts the series. If no parameter is specified it will sort the series
based on the value of the items found in it in alphabetical order. If a
SorterConcept is specified as parameter it's compare method will be used
to produce the sorting of the series.
Returns a stream representing the simple text rendering of this concept.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.toTXT
-- the result is --
red
green
blue
Returns a stream representing the XML rendering of this concept.
$s typeof Series
$s.add("red")
$s.add("green")
$s.add("blue")
print $s.toTXT
-- the result is --
redgreenblue